Android Studio:运行/调试发布版本的应用程序 [英] Android Studio: run/debug release version of app
问题描述
我已将 gradle build 添加到 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屋!