To do the Android development debug is unavoidable sometimes want to know someone else's program or want to debug the system code how to do?
Now let's talk about how to debug our own program
1. For example, we have our own package name is Com.example.testjava We do not use the debug as method to open the DDMS directly below the breakpoint to select our process and then click on the Green Bug-like button on the top
You can debug with the next breakpoint
2. But sometimes we don't just want to debug our programs, like debugging other people's programs or trying to debug the system's code when we decompile.
Take system.process. If we have downloaded the source code want to start debug but we select the system.process process click the Debug button will jump out of this dialog box to tell us that we can not debug
In this case, we also set a breakpoint in the source code will not debug how to do it?
We can use the following method to select the process we want to debug in Ddms and then do not click the Debug button we go back to the Java view click on the Project Right button debug as-> Debug Config
The following dialog box pops up:
If we double-click the remote Java application, we'll set up a remoting port. We're going to have to project our project to debug. The port below is set to 8700 and then click Debug in the lower-right corner to debug.
Back in the DDMS view, we'll find that the process we selected has the debug sign.
In this way we can easily debug the system code and other APK process code. OK, let's say so much today, bye.