The run configurations in Android Studio only let you deploy the default (debugging) APK, but I have built a release APK by running gradle assembleDebug from within Android Studio (as an external tool) and would like to deploy that instead. But it doesn't seem like you can change the APK which Android Studio installs. There is an option to deploy a custom artifact, but I'm not sure what that is, or if it would help, and anyway, there doesn't seem to be an option to create a new artifact in the Android Studio Project Structure dialog.
Does anyone know how I can specify the path of the APK which Android Studio deploys? I know I can install from the command line with adb, but it would speed things up if I could just click a button. Thanks.
Major differences are the debug apk and the release apk: For debug builds the apk will be signed with the default debug signing keys with debug flag enabled. For release apk you will have to explicitly specify the apk to sign with and the debug flag will be turned off so that it cannot be debugged.
To generate a signed APK file, open the Build menu from the toolbar and select Generate Signed Bundle/APK. This opens up a screen where you have to select between creating an Android App Bundle and creating an APK file. Check the APK radio button and proceed to the next window.
Android Studio 3.0 and higher allow you to profile and debug APKs without having to build them from an Android Studio project. However, you need to make sure you're using an APK with debugging enabled. To start debugging an APK, click Profile or debug APK from the Android Studio Welcome screen.
On the left should be a "Build Variants" tab. There you can switch between your build types. If there no tabs visible than look left buttom for a monitor symbol and click it. Then you should find the build types. The selected one will be installed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With