1. Set the android phone for USB debug mode. Steps: Menu---> Settings---> Application---> Development, select "USB Debugging"
2. Connect your phone and computer with USB and make sure it is successful. Step: Perform C:\ADB devices under Windows to see if the phone is connected successfully.
3. Set the application to debug mode. Action: Edit androidmanifest.xml Add debug parameter Android:debuggable= "True", as follows:
<application android:icon= "@drawable/icon" android:label= "@string/app_name" android:debuggable= "true" >
4. Perform a real-machine debug operation: In the Eclipse Debug dialog box, select Manual in the target window, click the "Debug" button, select the real machine device, and start debugging.
Note: Regardless of whether the eclipse environment is enabled or not, any Android software that has an exception running on the real machine can be viewed under the command-line window for specific exception information:
Execution:. \adb Logcat can see more system exception messages. In these messages, be careful to look at caused by: lines that indicate which line of code is wrong
Reference: http://www.codes51.com/article/detail_94421.html
How to set up Android in real-machine debugging