Android Studio:运行/调试版本的应用程序 [英] Android Studio: run/debug release version of app
问题描述
我已将毕业生版添加到Android应用,并可以从Android Studio启动。
gradlew build
生成调试和发布(签名,使用proguard)。
I have added gradle build to Android app, and can launch from Android Studio.
gradlew build
produces debug and released (signed, minified with proguard) versions.
buildTypes {
debug {
zipAlignEnabled true
versionNameSuffix "-" + buildDateTime()
}
release {
minifyEnabled true
// Eclipse project.properties # proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
zipAlignEnabled true
signingConfig signingConfigs.release
versionNameSuffix "-" + buildDateTime()
}
但是当我 adb install
设备启动时崩溃的发行版本。
But when I adb install
on device the release version it crashes on start.
如何从Android Studio运行/调试应用程序的发行版,以找到确切的问题?
或者我可以在Eclipse中手动发布签名的apk吗?
Or can I debug manually released signed apk in Eclipse?
推荐答案
有一个名为Build Variants的窗口,您可以在其中选择要在仿真器/设备上安装的版本。
There's a window called 'Build Variants' where you can choose, which version you want to be installed on your emulator/device.
您还必须在发行版中添加 debuggable true
才能调试它。
You also have to add debuggable true
to your release build to be able to debug it.
这篇关于Android Studio:运行/调试版本的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!