How do you proceed to build standalone release apk

How do you proceed to build standalone release apk

Hi all

Today I managed to build release signed variant of apk containing targeting both abiearm-v7a and arm64-v8a and run it on the real device.
I used Android Studio’s Build Apk menu command, then Run menu command and my App runs on my USB connected phone. And it works fine. :slight_smile:


After that I want to show my app to my friend. Here is what I did to run my apk on his phone:

  1. Connect his phone on my PC’s USB port
  2. Copy my apk to his phone
  3. On his phone using File Manager App, I clicked on the apk file.

… and installation process failed to install apk. :frowning_face: The reason - INSTALL_FAILED_TEST_ONLY, which Android Studio puts silently in AndroidManifest.xml.

So, if all tests are passed successfully and I’m ready to show my apk, how to proceed to get fully functional apk in release mode (without any debug or test info), which can be installed by copy/paste and click on arbitrary phone, without need to upload it to any App store?

Do I have to use adb console tool for the final build, not Android Studio?


The easiest way it to follow this tutorial. If you need to build the APK without Android Studio, you can follow this other tutorial.

Both ways are possible for cocos2d-x. I would prefer the second one, because it also signs the APK if you set the build type to release and it’s the better solution for headless build (like build servers).