Doc change: Tools section of the dev guide restructuring
Change-Id: I747dfc71e25f76b42476cd7de3c7087aa4e90850
This commit is contained in:
364
docs/html/guide/developing/tools/android.jd
Normal file
364
docs/html/guide/developing/tools/android.jd
Normal file
@@ -0,0 +1,364 @@
|
||||
page.title=android
|
||||
@jd:body
|
||||
|
||||
<p>{@code android} is an important development tool that lets you:</p>
|
||||
|
||||
<ul>
|
||||
<li>Create, delete, and view Android Virtual Devices (AVDs). See <a href=
|
||||
"{@docRoot}guide/developing/devices/managing-avds-cmdline.html">
|
||||
Creating and Managing AVDs on the Command Line</a>.</li>
|
||||
|
||||
<li>Create and update Android projects. See <a href=
|
||||
"{@docRoot}guide/developing/projects/projects-cmdline.html">Creating and Managing Projects on
|
||||
the Command Line</a>.</li>
|
||||
|
||||
<li>Update your Android SDK with new platforms, add-ons, and documentation. See <a href=
|
||||
"{@docRoot}sdk/adding-components.html">Adding SDK Components</a>.</li>
|
||||
</ul>If you are using Eclipse, the <code>android</code> tool's features are integrated
|
||||
into ADT, so you should not need to use this tool directly.
|
||||
|
||||
<h2>Syntax</h2>
|
||||
<pre>android [global options] action [action options]</pre>
|
||||
|
||||
<h3>Global Options</h3>
|
||||
|
||||
<dl>
|
||||
<dt><code>-s</code></dt>
|
||||
|
||||
<dd>Silent mode: only errors are printed out</dd>
|
||||
|
||||
<dt><code>-h</code></dt>
|
||||
|
||||
<dd>Usage help</dd>
|
||||
|
||||
<dt><code>-v</code></dt>
|
||||
|
||||
<dd>Verbose mode: errors, warnings and informational messages are printed.</dd>
|
||||
</dl>
|
||||
|
||||
<h3>AVD actions and options</h3>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th width="15%">Action</th>
|
||||
|
||||
<th width="20%">Option</th>
|
||||
|
||||
<th width="30%">Description</th>
|
||||
|
||||
<th>Comments</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td rowspan="6"><code>create avd</code></td>
|
||||
|
||||
<td><code>-n <name></code></td>
|
||||
|
||||
<td>The name for the AVD.</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-t <targetID></code></td>
|
||||
|
||||
<td>Target ID of the system image to use with the new AVD. To obtain a list of available
|
||||
targets, use <code>android list targets</code></td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-c <path>|<size>[K|M]</code></td>
|
||||
|
||||
<td>The path to the SD card image to use with this AVD or the size of a new SD card image to
|
||||
create for this AVD. For example, <code>-c path/to/sdcard</code> or <code>-c
|
||||
1000M</code>.</td>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-f</code></td>
|
||||
|
||||
<td>Force creation of the AVD</td>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-p <path></code></td>
|
||||
|
||||
<td>Path to the location at which to create the directory for this AVD's files.</td>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-s <name>|<width>-<height></code></td>
|
||||
|
||||
<td>The skin to use for this AVD, identified by name or dimensions. The <code>android</code>
|
||||
tool scans for a matching skin by name or dimension in the <code>skins/</code> directory of
|
||||
the target referenced in the <code>-t <targetID></code> argument. For example, <code>-s
|
||||
HVGA-L</code></td>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>delete avd</code></td>
|
||||
|
||||
<td><code>-n <name></code></td>
|
||||
|
||||
<td>The name of the AVD to delete</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td rowspan="3"><code>move avd</code></td>
|
||||
|
||||
<td><code>-n <name></code></td>
|
||||
|
||||
<td>The name of the AVD to move</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-p <path></code></td>
|
||||
|
||||
<td>Path to the location at which to create the directory for this AVD's files.</td>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-r <new-name></code></td>
|
||||
|
||||
<td>New name of the AVD if you want to rename it</td>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>update avd</code></td>
|
||||
|
||||
<td><code>-n <name></code></td>
|
||||
|
||||
<td>The name of the AVD to move</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Project actions and options</h3>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th width="15%">Action</th>
|
||||
|
||||
<th width="20%">Option</th>
|
||||
|
||||
<th width="30%">Description</th>
|
||||
|
||||
<th>Comments</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td rowspan="5"><code>create project</code></td>
|
||||
|
||||
<td><code>-n <name></code></td>
|
||||
|
||||
<td>The name for the project</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-t <targetID></code></td>
|
||||
|
||||
<td>Target ID of the system image to use with the new AVD. To obtain a list of available
|
||||
targets, use <code>android list targets</code></td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-k <path>|<size>[K|M]</code></td>
|
||||
|
||||
<td>Package namespace</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-a</code></td>
|
||||
|
||||
<td>Name for the default Activity class</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-p <path></code></td>
|
||||
|
||||
<td>Location of your project directory</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td rowspan="5"><code>update project</code></td>
|
||||
|
||||
<td><code>-n <name></code></td>
|
||||
|
||||
<td>The name of the project to update</td>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-p <path></code></td>
|
||||
|
||||
<td>Location path of the project</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-l <library path></code></td>
|
||||
|
||||
<td>Location path of an Android Library to add, relative to the main project</td>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-s <subprojects></code></td>
|
||||
|
||||
<td>Update any projects in subfolders such as test projects</td>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-t <targetID></code></td>
|
||||
|
||||
<td>Target id to set for the project</td>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td rowspan="3"><code>create-test-project</code></td>
|
||||
|
||||
<td><code>-n <name></code></td>
|
||||
|
||||
<td>The name of the project</td>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-p <path></code></td>
|
||||
|
||||
<td>Location path of the project</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-m <main></code></td>
|
||||
|
||||
<td>The name of the project</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td rowspan="2"><code>update-test-project</code></td>
|
||||
|
||||
<td><code>-p <path></code></td>
|
||||
|
||||
<td>Location path of the project to test, relative to the new project</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-m <main></code></td>
|
||||
|
||||
<td>The main class of the project to test</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td rowspan="4"><code>create-lib-project</code></td>
|
||||
|
||||
<td><code>-k <packageName></code></td>
|
||||
|
||||
<td>(Required) Package name of the library project</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-p <path></code></td>
|
||||
|
||||
<td>Location path of the project</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-t <targetID></code></td>
|
||||
|
||||
<td>Target ID of the library project</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-n <name></code></td>
|
||||
|
||||
<td>The name of the project</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td rowspan="3"><code>update-lib-project</code></td>
|
||||
|
||||
<td><code>-p <path></code></td>
|
||||
|
||||
<td>Location path of the project</td>
|
||||
|
||||
<td>Required</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-l <libraryPath></code></td>
|
||||
|
||||
<td>Location path of an Android Library to add, relative to the main project</td>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-t <name></code></td>
|
||||
|
||||
<td>Target ID of the library project</td>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Update actions</h3>
|
||||
<dl>
|
||||
<dt><code>update adb</code></dt>
|
||||
<dd>Updates adb to support the USB devices declared in the SDK add-ons.</dd>
|
||||
|
||||
<dt><code>update sdk</code></dt>
|
||||
<dd>Updates the SDK by suggesting new platforms to install if available.</dd>
|
||||
64
docs/html/guide/developing/tools/dmtracedump.jd
Normal file
64
docs/html/guide/developing/tools/dmtracedump.jd
Normal file
@@ -0,0 +1,64 @@
|
||||
page.title=dmtracedump
|
||||
@jd:body
|
||||
|
||||
|
||||
<p><code>dmtracedump</code> is a tool that gives you an alternate way of generating
|
||||
graphical call-stack diagrams from trace log files (instead of using Traceview).</p>
|
||||
|
||||
<p>This document is a reference to the available command line options. For more information on generating trace
|
||||
logs, see <a href="{@docRoot}guide/developing/debugging/debugging-tracing.html">Profiling with
|
||||
Traceview and dmtracedump</a>.</p>
|
||||
|
||||
<p>The usage for <code>dmtracedump</code> is:</p>
|
||||
<pre>
|
||||
dmtracedump [-ho] [-s sortable] [-d trace-base-name] [-g outfile] <trace-base-name>
|
||||
</pre>
|
||||
|
||||
<p>The tool then loads trace log data from <code><trace-base-name>.data</code> and
|
||||
<trace-base-name>.key. The table below lists the options for dmtracedump.</p>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><nobr><code>-d <em><trace-base-name></em></code></nobr></td>
|
||||
|
||||
<td>Diff with this trace name</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-g <em><outfile></em></code></td>
|
||||
|
||||
<td>Generate output to <outfile></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-h</code></td>
|
||||
|
||||
<td>Turn on HTML output</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-o</code></td>
|
||||
|
||||
<td>Dump the trace file instead of profiling</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-d <em><trace-base-name></em></code></td>
|
||||
|
||||
<td>URL base to the location of the sortable javascript file</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-t <percent></code></td>
|
||||
|
||||
<td>Minimum threshold for including child nodes in the graph (child's inclusive time as a
|
||||
percentage of parent inclusive time). If this option is not used, the default threshold is
|
||||
20%.</td>
|
||||
</tr>
|
||||
</table>
|
||||
File diff suppressed because it is too large
Load Diff
14
docs/html/guide/developing/tools/hprof-conv.jd
Normal file
14
docs/html/guide/developing/tools/hprof-conv.jd
Normal file
@@ -0,0 +1,14 @@
|
||||
page.title=HPROF Converter
|
||||
@jd:body
|
||||
|
||||
<p>
|
||||
The <code>hprof-conv</code> tool converts the HPROF file that is
|
||||
generated by the Android SDK tools to a standard format so you
|
||||
can view the file in a profiling tool of your choice. </p>
|
||||
|
||||
<pre> hprof-conv <infile> <outfile></pre>
|
||||
|
||||
<p>
|
||||
You can use "-" for <code><infile></code> or <code><outfile></code>
|
||||
to specify stdin or stdout.
|
||||
</p>
|
||||
@@ -10,46 +10,34 @@ includes a variety of other tools for debugging, packaging, and installing your
|
||||
applications on the emulator. </p>
|
||||
|
||||
<dl>
|
||||
<dt><a href="adt.html">Android Development Tools Plugin</a> (for the Eclipse IDE)</dt>
|
||||
<dd>The ADT plugin adds powerful extensions to the Eclipse integrated environment,
|
||||
making creating and debugging your Android applications easier and faster. If you
|
||||
use Eclipse, the ADT plugin gives you an incredible boost in developing Android
|
||||
applications.</dd>
|
||||
<dt><a href="{@docRoot}sdk/eclipse-adt.html">Android Development Tools Plugin</a> (for the Eclipse IDE)</dt>
|
||||
<dd>The ADT plugin adds powerful extensions to the Eclipse integrated environment,
|
||||
making creating and debugging your Android applications easier and faster.</dd>
|
||||
<dt><a href="emulator.html">Android Emulator</a></dt>
|
||||
<dd>A QEMU-based device-emulation tool that you can use to design,
|
||||
debug, and test your applications in an actual Android run-time environment. </dd>
|
||||
|
||||
<dt><a href="avd.html">Android Virtual Devices (AVDs)</a></dt>
|
||||
<dd>Virtual device configurations that you create, to model device
|
||||
characteristics in the Android Emulator. In each configuration, you can
|
||||
specify the Android platform to run, the hardware options, and the
|
||||
emulator skin to use. Each AVD functions as an independent device with
|
||||
it's own storage for user data, SD card, and so on. </dd>
|
||||
|
||||
<dt><a href="hierarchy-viewer.html">Hierarchy Viewer</a></dt>
|
||||
<dd>The Hierarchy Viewer tool allows you to debug and optimize your user interface.
|
||||
It provides a visual representation of your layout's hierarchy of Views and a magnified inspector
|
||||
of the current display with a pixel grid, so you can get your layout just right.
|
||||
</dd>
|
||||
<dt><a href="bmgr.html">bmgr</a></dt>
|
||||
|
||||
<dd>A shell tool you can use to interact with the Backup Manager on Android devices
|
||||
supporting API Level 8 or greater. It provides commands to invoke backup and restore operations
|
||||
so that you don't need to repeatedly wipe data or take similar intrusive steps in order to test
|
||||
your application's backup agent. These commands are accessed via the adb shell.
|
||||
</dd>
|
||||
|
||||
<dt><a href="layoutopt.html">layoutopt</a></dt>
|
||||
<dd>This tool lets you quickly analyze your application's layouts for
|
||||
efficiency.
|
||||
<dd>This tool lets you quickly analyze your application's layouts in order to
|
||||
optimize them for efficiency.
|
||||
</dd>
|
||||
|
||||
<dt><a href="draw9patch.html">Draw 9-patch</a></dt>
|
||||
<dd>The Draw 9-patch tool allows you to easily create a
|
||||
{@link android.graphics.NinePatch} graphic using a WYSIWYG editor. It also previews stretched
|
||||
versions of the image, and highlights the area in which content is allowed.
|
||||
</dd>
|
||||
|
||||
<dt><a href="ddms.html" >Dalvik Debug Monitor
|
||||
Service</a> (ddms)</dt>
|
||||
<dd>Integrated with Dalvik, the Android platform's custom VM, this tool
|
||||
lets you manage processes on an emulator or device and assists in debugging.
|
||||
You can use it to kill processes, select a specific process to debug,
|
||||
generate trace data, view heap and thread information, take screenshots
|
||||
of the emulator or device, and more. </dd>
|
||||
<dt><a href="draw9patch.html">Draw 9-patch</a></dt>
|
||||
<dd>The Draw 9-patch tool allows you to easily create a
|
||||
{@link android.graphics.NinePatch} graphic using a WYSIWYG editor. It also previews stretched
|
||||
versions of the image, and highlights the area in which content is allowed.
|
||||
</dd>
|
||||
|
||||
|
||||
<dt><a href="adb.html" >Android Debug Bridge</a> (adb)</dt>
|
||||
<dd>The adb tool lets you install your application's .apk files on an
|
||||
@@ -58,45 +46,28 @@ efficiency.
|
||||
on an Android emulator or device.
|
||||
<p>This is located in {@code <sdk>/platform-tools/}.</p></dd>
|
||||
|
||||
<dt><a href="aapt.html">Android Asset
|
||||
Packaging Tool</a> (aapt)</dt>
|
||||
<dd>The aapt tool lets you create .apk files containing the binaries and
|
||||
resources of Android applications.</dd>
|
||||
<dt><a href="hprof-conv.html">hprof-conv</a></dt>
|
||||
|
||||
<dt><a href="aidl.html" >Android Interface
|
||||
Description Language</a> (aidl)</dt>
|
||||
<dd>Lets you generate code for an interprocess interface, such as what
|
||||
a service might use.</dd>
|
||||
|
||||
<dt><a href="adb.html#sqlite">sqlite3</a></dt>
|
||||
<dd>Included as a convenience, this tool lets you access the SQLite data
|
||||
<dd>A tool that converts the HPROF file that is generated by the Android SDK tools to a
|
||||
standard format so you can view the file in a profiling tool of your choice.</dd>
|
||||
|
||||
<dt><a href="sqlite3.html">sqlite3</a></dt>
|
||||
<dd>Included as a convenience, this tool lets you access the SQLite data
|
||||
files created and used by Android applications.</dd>
|
||||
|
||||
<dt><a href="traceview.html" >Traceview</a></dt>
|
||||
<dd> This tool produces graphical analysis views of trace log data that you
|
||||
can generate from your Android application. </dd>
|
||||
|
||||
<dt><a href="othertools.html#mksdcard">mksdcard</a></dt>
|
||||
<dd>Helps you create a disk image that you can use with the emulator,
|
||||
<dt><a href="mksdcard.html">mksdcard</a></dt>
|
||||
<dd>Helps you create a disk image that you can use with the emulator,
|
||||
to simulate the presence of an external storage card (such as an SD card).</dd>
|
||||
|
||||
<dt><a href="monkey.html">UI/Application
|
||||
|
||||
<dt><a href="othertools.html#dx">dx</a></dt>
|
||||
<dd>The dx tool rewrites .class bytecode into Android bytecode
|
||||
(stored in .dex files.)</dd>
|
||||
|
||||
<dt><a href="monkey.html">UI/Application
|
||||
Exerciser Monkey</a></dt>
|
||||
<dd>The Monkey is a program that runs on your emulator or device and generates pseudo-random
|
||||
streams of user events such as clicks, touches, or gestures, as well as a number of system-
|
||||
level events. You can use the Monkey to stress-test applications that you are developing,
|
||||
in a random yet repeatable manner.</dd>
|
||||
<dd>A program that runs on your emulator or device and generates pseudo-random
|
||||
streams of user events such as clicks, touches, or gestures, as well as a number of system-level events.
|
||||
You can use the Monkey to stress-test applications that you are developing, in a random yet repeatable manner.</dd>
|
||||
|
||||
<dt><a href="monkeyrunner_concepts.html">monkeyrunner</a></dt>
|
||||
<dd>
|
||||
The monkeyrunner tool provides an API for writing Python programs that control an Android device
|
||||
or emulator from outside of Android code.
|
||||
</dd>
|
||||
<dt><a href="othertools.html#android">android</a></dt>
|
||||
|
||||
<dt><a href="android.html">android</a></dt>
|
||||
<dd>A script that lets you manage AVDs and generate <a
|
||||
href="http://ant.apache.org/" title="Ant">Ant</a> build files that
|
||||
you can use to compile your Android applications. </dd>
|
||||
@@ -105,5 +76,9 @@ efficiency.
|
||||
<dd>An important .apk optimization tool. This tool ensures that all uncompressed data starts
|
||||
with a particular alignment relative to the start of the file. This should always be used
|
||||
to align .apk files after they have been signed.</dd>
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
@@ -2,61 +2,20 @@ page.title=layoutopt
|
||||
@jd:body
|
||||
|
||||
<p><code>layoutopt</code> is a command-line tool that helps you optimize the
|
||||
layouts and layout hierarchies of your applications. You can run it against your
|
||||
layout files or resource directories to quickly check for inefficiencies or
|
||||
other types of problems that could be affecting the performance of your
|
||||
application. </p>
|
||||
layouts and layout hierarchies of your applications.<p>
|
||||
|
||||
<p>To run the tool, open a terminal and launch <code>layoutopt
|
||||
<resources></code> from your SDK <code>tools/</code> directory. In the
|
||||
command, supply a list of uncompiled resource xml files or directories that you
|
||||
want to analyze. </p>
|
||||
|
||||
<p>When run, the tool loads the specified XML files and analyzes their layout
|
||||
structures and hierarchies according to a set of predefined rules. If it detects
|
||||
issues, it outputs information about the issues, giving filename, line numbers,
|
||||
description of issue, and for some types of issues a suggested resolution. </p>
|
||||
|
||||
<p>Here's an example of the output:</p>
|
||||
|
||||
<pre>$ layoutopt samples/
|
||||
samples/compound.xml
|
||||
7:23 The root-level <FrameLayout/> can be replaced with <merge/>
|
||||
11:21 This LinearLayout layout or its FrameLayout parent is useless
|
||||
samples/simple.xml
|
||||
7:7 The root-level <FrameLayout/> can be replaced with <merge/>
|
||||
samples/too_deep.xml
|
||||
-1:-1 This layout has too many nested layouts: 13 levels, it should have <= 10!
|
||||
20:81 This LinearLayout layout or its LinearLayout parent is useless
|
||||
24:79 This LinearLayout layout or its LinearLayout parent is useless
|
||||
28:77 This LinearLayout layout or its LinearLayout parent is useless
|
||||
32:75 This LinearLayout layout or its LinearLayout parent is useless
|
||||
36:73 This LinearLayout layout or its LinearLayout parent is useless
|
||||
40:71 This LinearLayout layout or its LinearLayout parent is useless
|
||||
44:69 This LinearLayout layout or its LinearLayout parent is useless
|
||||
48:67 This LinearLayout layout or its LinearLayout parent is useless
|
||||
52:65 This LinearLayout layout or its LinearLayout parent is useless
|
||||
56:63 This LinearLayout layout or its LinearLayout parent is useless
|
||||
samples/too_many.xml
|
||||
7:413 The root-level <FrameLayout/> can be replaced with <merge/>
|
||||
-1:-1 This layout has too many views: 81 views, it should have <= 80!
|
||||
samples/useless.xml
|
||||
7:19 The root-level <FrameLayout/> can be replaced with <merge/>
|
||||
11:17 This LinearLayout layout or its FrameLayout parent is useless</pre>
|
||||
|
||||
<p>The <code>layoutopt</code> tool is available in SDK Tools, Revision 3 or
|
||||
later. If you do not have SDK Tools r3 or later installed in your SDK, you can
|
||||
download it from the Android SDK repository site using the Android SDK and AVD
|
||||
Manager. For information, see <a
|
||||
href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a>.</p>
|
||||
<p>This document is a reference to the available command line options. For more information and sample
|
||||
output of the tool, see <a href="{@docRoot}guide/developing/debugging/debugging-ui.html#layoutopt.html">
|
||||
Optimizing layouts with layoutopt</a>.</p>
|
||||
|
||||
<h3>Usage</h3>
|
||||
|
||||
<p>To run <code>layoutopt</code> against a given list of layout resources:</p>
|
||||
|
||||
<pre>layoutopt <list of xml files or directories></pre>
|
||||
<pre>layoutopt <file_or_directory> ...</pre>
|
||||
|
||||
<p>For example:</p>
|
||||
|
||||
<pre>$ layoutopt res/layout-land</pre>
|
||||
<pre>$ layoutopt res/layout/main.xml res/layout-land/main.xml</pre>
|
||||
|
||||
|
||||
104
docs/html/guide/developing/tools/logcat.jd
Normal file
104
docs/html/guide/developing/tools/logcat.jd
Normal file
@@ -0,0 +1,104 @@
|
||||
page.title=logcat
|
||||
@jd:body
|
||||
<div></div>
|
||||
|
||||
<p>The Android logging system provides a mechanism for collecting and viewing system debug
|
||||
output. Logs from various applications and portions of the system are collected in a series of
|
||||
circular buffers, which then can be viewed and filtered by the <code>logcat</code> command. You can use
|
||||
<code>logcat</code> from an ADB shell to view the log messages.</p>
|
||||
|
||||
<p>This document is a reference to the available command line options. For more information on <code>logcat</code>, see
|
||||
<a href="{@docRoot}guide/developing/debugging/debugging-log.html">Reading and Writing Log Messages</a>. For more
|
||||
information on accessing <code>logcat</code> from DDMS, instead of the command line, see the documentation for the
|
||||
<a href="{@docRoot}guide/developing/debugging/ddms.html">Dalvik Debug Monitor Server</a>.
|
||||
</p>
|
||||
|
||||
<h3>Syntax</h3>
|
||||
<pre>
|
||||
[adb] logcat [<option>] ... [<filter-spec>] ...
|
||||
</pre>
|
||||
|
||||
<p>You can run <code>logcat</code> as an adb command or directly in a shell prompt
|
||||
of your emulator or connected device. To view log output using adb, navigate to your SDK
|
||||
<code>platform-tools/</code> directory and execute:/p>
|
||||
<pre>
|
||||
$ adb logcat
|
||||
</pre>
|
||||
|
||||
<p>You can create a shell connection to a device and execute:</p>
|
||||
<pre>
|
||||
$ adb shell
|
||||
# logcat
|
||||
</pre>
|
||||
|
||||
<h3>Options</h3>
|
||||
<p>The following table describes the command line options of <code>logcat</code>.</p>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-b <buffer></code></td>
|
||||
|
||||
<td>Loads an alternate log buffer for viewing, such as <code>event</code> or
|
||||
<code>radio</code>. The <code>main</code> buffer is used by default. See <a href=
|
||||
"#alternativebuffers">Viewing Alternative Log Buffers</a>.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-c</code></td>
|
||||
|
||||
<td>Clears (flushes) the entire log and exits.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-d</code></td>
|
||||
|
||||
<td>Dumps the log to the screen and exits.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-f <filename></code></td>
|
||||
|
||||
<td>Writes log message output to <code><filename></code>. The default is
|
||||
<code>stdout</code>.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-g</code></td>
|
||||
|
||||
<td>Prints the size of the specified log buffer and exits.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-n <count></code></td>
|
||||
|
||||
<td>Sets the maximum number of rotated logs to <code><count></code>. The default value
|
||||
is 4. Requires the <code>-r</code> option.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-r <kbytes></code></td>
|
||||
|
||||
<td>Rotates the log file every <code><kbytes></code> of output. The default value is
|
||||
16. Requires the <code>-f</code> option.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-s</code></td>
|
||||
|
||||
<td>Sets the default filter spec to silent.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-v <format></code></td>
|
||||
|
||||
<td>Sets the output format for log messages. The default is <code>brief</code> format. For a
|
||||
list of supported formats, see <a href="#outputformat">Controlling Log Output
|
||||
Format</a>.</td>
|
||||
</tr>
|
||||
</table>
|
||||
53
docs/html/guide/developing/tools/mksdcard.jd
Normal file
53
docs/html/guide/developing/tools/mksdcard.jd
Normal file
@@ -0,0 +1,53 @@
|
||||
page.title=mksdcard
|
||||
@jd:body
|
||||
|
||||
<p>The <code>mksdcard</code> tool lets you quickly create a FAT32 disk image that you can load in the
|
||||
emulator, to simulate the presence of an SD card in the device. Because you can specify an SD
|
||||
card while creating an AVD in the AVD Manager, you usually use that feature to create an SD card.
|
||||
This tool creates an SD card that is not bundled with an AVD, so it is useful for situations
|
||||
where you need to share a virtual SD card between multiple emulators.</p>
|
||||
|
||||
<h3>Usage</h3>
|
||||
<pre>
|
||||
mksdcard -l <label> <size> <file>
|
||||
</pre>
|
||||
|
||||
<h3>Options</h3>
|
||||
The following table describes the command-line options of <code>mksdcard</code>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>-l</code></td>
|
||||
|
||||
<td>A volume label for the disk image to create.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>size</code></td>
|
||||
|
||||
<td>An integer that specifies the size (in bytes) of disk image to create. You can also
|
||||
specify size in kilobytes or megabytes, by appending a "K" or "M" to <size>. For
|
||||
example, <code>1048576K</code>, <code>1024M</code>.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>file</code></td>
|
||||
|
||||
<td>The path/filename of the disk image to create.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>Once you have created the disk image file, you can load it in the emulator at startup using
|
||||
the emulator's <code>-sdcard</code> option. For more information, see <a href=
|
||||
"{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a>.</p>
|
||||
|
||||
<p>The usage for the <code>-sdcard</code> option is as follows:</p>
|
||||
<pre>emulator -sdcard <file></pre>
|
||||
|
||||
<h3>Example</h3>
|
||||
mksdcard -l mySdCard 1024M mySdCardFile.img
|
||||
57
docs/html/guide/developing/tools/sqlite3.jd
Normal file
57
docs/html/guide/developing/tools/sqlite3.jd
Normal file
@@ -0,0 +1,57 @@
|
||||
page.title=sqlite3
|
||||
@jd:body
|
||||
|
||||
<p>From a remote shell to your device or from your host machine, you can use the <a href=
|
||||
"http://www.sqlite.org/sqlite.html">sqlite3</a> command-line program to manage SQLite databases
|
||||
created by Android applications. The <code>sqlite3</code> tool includes many useful commands,
|
||||
such as <code>.dump</code> to print out the contents of a table and <code>.schema</code> to print
|
||||
the SQL CREATE statement for an existing table. The tool also gives you the ability to execute
|
||||
SQLite commands on the fly.</p>
|
||||
|
||||
<p>To use <code>sqlite3</code> from a remote shell:</p>
|
||||
|
||||
<ol>
|
||||
<li>Enter a remote shell by entering the following command:
|
||||
<pre>adb [-d|-e|-s {<serialNumber>}] shell</pre>
|
||||
</li>
|
||||
|
||||
<li>From a remote shell, start the <code>sqlite3</code> tool by entering the following command:
|
||||
<pre>sqlite3</pre>
|
||||
|
||||
<p>You can also optionally specify a full path to a database that you want to explore.
|
||||
Emulator/device instances store SQLite3 databases in the directory
|
||||
<code>/data/data/<package_name>/databases/</code>.</p>
|
||||
</li>
|
||||
|
||||
<li>Once you invoke <code>sqlite3</code>, you can issue <code>sqlite3</code> commands in the
|
||||
shell. To exit and return to the adb remote shell, enter <code>exit</code> or press
|
||||
<code>CTRL+D</code>.</li>
|
||||
</ol>
|
||||
|
||||
|
||||
<p>Here's an example:</p>
|
||||
<pre>$ adb -s emulator-5554 shell
|
||||
# sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db
|
||||
SQLite version 3.3.12
|
||||
Enter ".help" for instructions
|
||||
<em>.... enter commands, then quit...</em>
|
||||
# sqlite> .exit
|
||||
</pre>
|
||||
|
||||
<p>To use <code>sqlite3</code> locally, instead of within a shell,
|
||||
pull the database file from the device and start {@code sqlite3}:</p>
|
||||
|
||||
<ol>
|
||||
<li>Copy a database file from your device to your host machine:
|
||||
<pre>
|
||||
adb pull <database-file-on-device>
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
<li>Start the sqlite3 tool from the <code>/tools</code> directory, specifying the database
|
||||
file:
|
||||
<pre>
|
||||
sqlite3 <database-file-on-host>
|
||||
</pre>
|
||||
</li>
|
||||
</ol>
|
||||
Reference in New Issue
Block a user