<metaname="Description" content="The Dev Tools application is installed by default on all system images included with the SDK, so you can use it with the Android Emulator. With the Dev Tools application, you can enable a number of settings on your device that will make it easier to test…">
<li><ahref="http://developer.android.com/tools/debugging/debugging-log.html"><spanclass="en">Reading and Writing Logs</span></a></li>
<li><ahref="http://developer.android.com/tools/debugging/improving-w-lint.html"><spanclass="en">Improving Your Code with lint</span></a></li>
<li><ahref="http://developer.android.com/tools/debugging/debugging-ui.html"><spanclass="en">Optimizing your UI</span></a></li>
<li><ahref="http://developer.android.com/tools/debugging/debugging-tracing.html"><spanclass="en">Profiling with Traceview and dmtracedump</span></a></li>
<li><ahref="http://developer.android.com/tools/debugging/systrace.html"><spanclass="en">Analyzing Display and Performance</span></a></li>
<li><ahref="http://developer.android.com/tools/debugging/debugging-memory.html">Investigating Your RAM Usage</a></li>
<li><ahref="debugging-devtools.html"><spanclass="en">Using the Dev Tools App</span></a></li>
<li><ahref="../publishing/app-signing-eclipse.html">Signing Your Apps</a></li>
</ul>
</li><!-- end of Eclipse -->
</ul><!-- nav -->
<scripttype="text/javascript">
<!--
buildToggleLists();
changeNavLang(getLangPref());
//-->
</script>
</div>
</div><!-- end side-nav -->
<script>
$(document).ready(function(){
scrollIntoView("devdoc-nav");
});
</script>
<divclass="col-13" id="doc-col" >
<h1itemprop="name" >Using the Dev Tools App</h1>
<divid="jd-content">
<divclass="jd-descr" itemprop="articleBody">
<p>The Dev Tools application is installed by default on all system images included with the SDK,
so you can use it with the Android Emulator. With the Dev Tools application, you can enable a
number of settings on your device that will make it easier to test and debug your applications.</p>
<p> The Dev Tools application relies on a number of permissions that are not available for
third party applications. If you'd like to install the Dev Tools application
on a real development device, you'd have to build a system image for that device and sign
the Dev Tools application with the same key as used for the system image.</p>
<p>To get started, launch the Dev Tools application and select <strong>Development Settings</strong>. This will
open the Development Settings page with the following options (among others):</p>
<dl>
<dt><strong>Debug app</strong></dt>
<dd>
Lets you select the application to debug. You do not need to set this to attach a debugger,
but setting this value has two effects:
<ul>
<li>It will prevent Android from throwing an error if you pause on a breakpoint for a long
time while debugging.</li>
<li>It will enable you to select the <em>Wait for Debugger</em> option to pause application
startup until your debugger attaches (described next).</li>
</ul>
</dd>
<dt><strong>Wait for debugger</strong></dt>
<dd>Blocks the selected application from loading until a debugger attaches. This way you can
set a breakpoint in <code><ahref="http://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle)">onCreate()</a></code>,
which is important to debug the startup process of an Activity.
When you change this option, any currently running instances of the selected application will
be killed. In order to check this box, you must have selected a debug application as described
in the previous option. You can do the same thing by adding <code><ahref="http://developer.android.com/reference/android/os/Debug.html#waitForDebugger()">waitForDebugger()</a></code> to your code.</dd>
<dt><strong>Show screen updates</strong></dt>
<dd>Flashes a momentary pink rectangle on any screen sections that are being redrawn. This is
very useful for discovering unnecessary screen drawing.</dd>
<dd>Tells the system to destroy an activity as soon as it is stopped (as if Android had to
reclaim memory). This is very useful for testing the <code><ahref="http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle)">onSaveInstanceState(Bundle)</a></code> / <code><ahref="http://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle)">onCreate(android.os.Bundle)</a></code> code path, which would otherwise be difficult
to force. Choosing this option will probably reveal a number of problems in your application
due to not saving state. For more information about saving an activity's state, see the