Android debugging shortcuts and related skills

Source: Internet
Author: User

Android debugging shortcuts and related skills

1. Set breakpoints

Method 1: double-click the blank column on the left of a line.

Method 2: ctrl + shift + B

The first operation is "add", and the second operation is "cancel.

Ii. Shortcut Keys for debugging

1. [Ctrl + Shift + B]: Set a breakpoint or cancel a breakpoint in the current row.

2. [F11]: debug the program that was last executed.

3. [Ctrl + F11]: run the program that was last executed.

4. [F5]: trace the method. When the program executes a method, press [F5] to track the method.

5. [F6]: One-step execution program.

6. [F7]: After the method is executed, the last statement that calls this method is returned.

7. [F8]: continue to run until the next breakpoint or program ends.

3. Stay and view variable values

Right-click a variable and choose Watch. The Expressions box is displayed to view the variable value.


Iv. Log information printer

There are five commonly used logs: Log. v () Log. d () Log. I () Log. w () Log. e ().
Corresponds to VERBOSE, DEBUG, INFO, WARN, and ERROR according to the first letter.

5. Share some debugging tips in Eclipse
Variables we watch and program breakpoints we add will not be automatically deleted by Eclipse. Unless we manually delete them, they will remain in the purple box. These values will slow down the Eclipse development tool, if there are too many bugs in Eclipse, it is likely to cause Eclipse to crash, making development very painful, we recommend that you manually clear all the program breakpoints and watched variables added in the purple box during each Debug and debugging. You only need to add the breakpoints required for this debugging, in this way, Eclipse will not be crashed by these slow processes.

References:

Http://xys289187120.blog.51cto.com/3361352/657169

Http://blog.sina.com.cn/s/blog_4b93170a0102dw6d.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.