如何使用Android Studio在发布模式下调试Android App [英] How to debug the Android App in release mode using Android studio

查看:275
本文介绍了如何使用Android Studio在发布模式下调试Android App的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,我必须在发布模式下运行我的Android应用程序.运行该应用程序时,必须像在调试模式下使用代码一样运行代码.在发布模式下运行时,断点没有达到,我在清单中添加了android:debuggable="true".断点仍然没有达到.任何帮助.

For some reason I have to run my Android App in release mode.I have to run through the code when running the app just like we use in debug mode. My break points are not hitting when I run in release mode, I have added android:debuggable="true" in manifest. Still the breakpoint is not hitting. Any help.

预先感谢

推荐答案

就我而言,我已经创建了与先前发行版相同的调试配置并开始调试.这意味着您必须在构建gradle中也要在调试版本中提供sign build.

In my case, I have created the debug configuration same as previous release build and started debugging. It means you have to give sign build in debug version also in build gradle.

signingConfigs {
    config {
        keyAlias 'abc'
        keyPassword 'xyz'
        storeFile file('<<KEYSTORE-PATH>>.keystore')
        storePassword 'password'
    }
}
buildTypes {
  debug {
      debuggable true
      signingConfig signingConfigs.config
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}

因此它与发行版本具有相同的符号,您可以在运行时进行调试.

So It will have the same sign as release build and you can debug when it runs.

这篇关于如何使用Android Studio在发布模式下调试Android App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆