且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 Android Studio 生成未签名的发布 apk

更新时间:2023-01-02 22:35:54

release 构建类型中,根本不指定 signingConfig,您的构建就成功了不签.发布版本不会选择调试版本获得的默认签名配置,因此它应该适用于那些.

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.

有一个讨论关于它的 adt-dev 邮件列表.

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

请记住,要从 Android Studio 构建,您需要转到 Gradle 任务窗口并选择 assembleRelease 任务;通过Make Project"进行的正常构建实际上并不构建最终的 APK.

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.