How to debug the Android App in release mode using Android studio

前端 未结 5 1848
不知归路
不知归路 2020-12-14 14:48

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 hitt

5条回答
  •  悲&欢浪女
    2020-12-14 15:21

    There's no "release mode". What you refer to is the build type which means steps taken during building (like minifying etc). Setting android:debuggable="true" will not automagically help, because when you "Run" the app instead of "Debug" you do not connect debugger to it so it will not stop for that particular reason.

    So you can set up your debug build to be produced the same way release is, but is quite unclear what is the reasoning behind your need and I got a feeling you are trying to go the wrong way (i.e. debug is usually not using ProGuard, while release build is and ProGuard changes the resulting binary so your breakpoints from source will not really work anyway).

提交回复
热议问题