| Robert Ly | ce4d229 | 2010-12-16 17:26:11 -0800 | [diff] [blame^] | 1 | page.title=Debugging Android Projects in Eclipse |
| 2 | @jd:body |
| 3 | |
| 4 | <div id="qv-wrapper"> |
| 5 | <div id="qv"> |
| 6 | <h2>In this document</h2> |
| 7 | |
| 8 | <ol> |
| 9 | <li><a href="#tools">The Debug Perspective</a></li> |
| 10 | |
| 11 | <li><a href="#toptips">The DDMS Perspective</a></li> |
| 12 | </ol> |
| 13 | </div> |
| 14 | </div> |
| 15 | |
| 16 | <p>If you are developing in Eclipse with the ADT plugin, you can use the built-in Java Debugger, |
| 17 | along with DDMS, to debug your applications. To access the debugger and |
| 18 | DDMS, Eclipse displays the debugger and DDMS features as perspectives, which are customized |
| 19 | Eclipse views that display certain tabs and windows depending on the perspective that you are in. |
| 20 | Eclipse also takes care of starting the ADB host daemon for you, so you do not have to run this |
| 21 | manually.</p> |
| 22 | |
| 23 | <h2>The Debug Perspective in Eclipse</h2> |
| 24 | |
| 25 | <p>The Debug Perspective in Eclipse gives you access to the following tabs:</p> |
| 26 | |
| 27 | <ul> |
| 28 | <li>Debug - Displays previously and currently debugged Android applications and its currently |
| 29 | running threads</li> |
| 30 | |
| 31 | <li>Variables - When breakpoints are set, displays variable values during code execution</li> |
| 32 | |
| 33 | <li>Breakpoints - Displays a list of the set breakpoints in your application code</li> |
| 34 | |
| 35 | <li>LogCat - Allows you to view system log messages in real time. The LogCat tab is also |
| 36 | available in the DDMS perspective.</li> |
| 37 | </ul> |
| 38 | <p>You can access the Debug Perspective by clicking <strong>Window > Open Perspective > |
| 39 | Debug</strong>. Refer to the appropriate documentation for the Eclipse debugger for more |
| 40 | information.</p> |
| 41 | |
| 42 | <h2>The DDMS Perspective</h2> |
| 43 | <p>The DDMS Perspective in Eclipse lets you access all of the features |
| 44 | of DDMS from within the Eclipse IDE. The following sections of DDMS are available to you:</p> |
| 45 | |
| 46 | <ul> |
| 47 | <li>Devices - Shows the list of devices and AVDs that are connected to ADB.</li> |
| 48 | |
| 49 | <li>Emulator Control - Lets you carry out device functions.</li> |
| 50 | |
| 51 | <li>LogCat - Lets you view system log messages in real time.</li> |
| 52 | |
| 53 | <li>Threads - Shows currently running threads within a VM.</li> |
| 54 | |
| 55 | <li>Heap - Shows heap usage for a VM.</li> |
| 56 | |
| 57 | <li>Allocation Tracker - Shows the memory allocation of objects.</li> |
| 58 | |
| 59 | <li>File Explorer - Lets you explore the device's file system.</li> |
| 60 | </ul> |
| 61 | <p>To access the DDMS perspective, go to <strong>Window > Open Perspective > |
| 62 | DDMS</strong>. If DDMS does not appear, go to <strong>Window > Open Perspective > Other |
| 63 | ...</strong> and select <strong>DDMS</strong> from the Open Perspective window that appears. For |
| 64 | more information on using DDMS, see <a href="ddms.html">Using the Dalvik Debug Monitor Server</a>. |
| 65 | </p> |