A simple and practical debugging application skill sharing in Android Development
preface
We should all know that in application development, we often print logs or debug, so as to analyze some information at runtime, so as to find bugs and problems. The debug function of Android studio is easy to use, but sometimes it is not so fast and convenient in some cases.
such as
So how to solve the above problem? In fact, you only need to execute one line of command
among
Execute the above command. When we start the target application again, we will get such a picture
Then, we will have enough time to use run - > attach debugger to Android process to bind the process debug. After binding, the dialog box disappears, and the next startup is normal (there is no dialog box above)
So one debug may not solve the problem, and multiple debugging is inevitable. Do you have to execute this command every time?
The answer is yes, but there is a better way. Namely
The above code is different from the previous one, which is expressed in a - persistent
If the problem is solved after multiple debugs, it is easy to restore normal startup
This debugging method is very simple, but it may save us a lot of valuable time. Hope to help you develop peers.
In addition, when you encounter efficiency problems in your development, you need to think and find a faster way to work, rather than clicking the debug button of Android studio every time in order to debug the code in oncreate method in application.
summary
The above is the whole content of this article. I hope the content of this article can bring some help to Android developers. If you have any questions, you can leave a message. Thank you for your support for programming tips.