Generating unsigned, release apk with Android Studio

后端 未结 3 1049
予麋鹿
予麋鹿 2020-12-25 14:01

I need to generate an unsigned, release APK (where someone else will then sign it and release it to the store- with the someone else handling the keys and e

相关标签:
3条回答
  • 2020-12-25 14:30

    Actually you can build an unsigned .APK just by building it:

    To generate it, on the left side of the Android Studio, there is a Build Variants menu (maybe written vertically). Click it.

    The Build Variants window tab has appeared, click debug and change it by release.

    Rebuild your project application > Build > Rebuild Project.

    Then click Run, a new window has appeared, click Run > Continue anyway > Choose the device you want to run with > OK.

    The application won't work on your device but the release build version, of your .apk, will be generated into the same directory as your debug ones:

    • C:\ANDROID_PROJECT_DIRECTORY\app\build\outputs\apk\

    You can note that the name is app-release-unsigned.apk and it was exactly what we wanted to have.

    More information on this tutorial website.

    0 讨论(0)
  • 2020-12-25 14:39

    I had to do the same thing (because app signing is handled elsewhere) and I simply rebuilt the project.

    To generate an unsigned release apk, select a release version in the Build Variants menu.

    Note: You may get a red cross in your app configuration on the top menu, ignore it.

    Rebuild your project application Build > Rebuild Project.

    You will find your app-release-unsigned.apk in:

    • ~\app\build\outputs\apk\release\

    Note: If you need to create other versions, save the generated apk because subsequent rebuilds will overwrite the current apk(...don't be like me).

    0 讨论(0)
  • 2020-12-25 14:41

    In the release build type, don't specify a signingConfig at all, and your build won't be signed. Release builds don't pick up the default signing config that debug builds get, so it should work for those.

    There's a discussion on the adt-dev mailing list about it.

    Bear in mind that to build from Android Studio, you'll need to go to the Gradle tasks window and choose the assembleRelease task; normal builds via "Make Project" don't actually build the final APK.

    0 讨论(0)
提交回复
热议问题