|
|
|
@@ -1,6 +1,7 @@
|
|
|
|
page.title=Android Debug Bridge
|
|
|
|
page.title=Android Debug Bridge
|
|
|
|
parent.title=Tools
|
|
|
|
parent.title=Tools
|
|
|
|
parent.link=index.html
|
|
|
|
parent.link=index.html
|
|
|
|
|
|
|
|
page.tags="adb"
|
|
|
|
@jd:body
|
|
|
|
@jd:body
|
|
|
|
|
|
|
|
|
|
|
|
<div id="qv-wrapper">
|
|
|
|
<div id="qv-wrapper">
|
|
|
|
@@ -101,10 +102,10 @@ option to specify the target device to which the command should be directed. </p
|
|
|
|
<p class="table-caption"><strong>Table 1.</strong> Available adb commands</p>
|
|
|
|
<p class="table-caption"><strong>Table 1.</strong> Available adb commands</p>
|
|
|
|
<table>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<th>Category</th>
|
|
|
|
<th>Category</th>
|
|
|
|
<th>Command</th>
|
|
|
|
<th>Command</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Comments</th>
|
|
|
|
<th>Comments</th>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
@@ -280,33 +281,33 @@ would issue the <code>install</code> command as soon as the emulator or device i
|
|
|
|
|
|
|
|
|
|
|
|
<p>Before issuing adb commands, it is helpful to know what emulator/device instances are connected to the adb server. You can generate a list of attached emulators/devices using the <code>devices</code> command: </p>
|
|
|
|
<p>Before issuing adb commands, it is helpful to know what emulator/device instances are connected to the adb server. You can generate a list of attached emulators/devices using the <code>devices</code> command: </p>
|
|
|
|
|
|
|
|
|
|
|
|
<pre class="no-pretty-print">adb devices</pre>
|
|
|
|
<pre class="no-pretty-print">adb devices</pre>
|
|
|
|
|
|
|
|
|
|
|
|
<p>In response, adb prints this status information for each instance:</p>
|
|
|
|
<p>In response, adb prints this status information for each instance:</p>
|
|
|
|
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<ul>
|
|
|
|
<li>Serial number — A string created by adb to uniquely identify an emulator/device instance by its
|
|
|
|
<li>Serial number — A string created by adb to uniquely identify an emulator/device instance by its
|
|
|
|
console port number. The format of the serial number is <code><type>-<consolePort></code>.
|
|
|
|
console port number. The format of the serial number is <code><type>-<consolePort></code>.
|
|
|
|
Here's an example serial number: <code>emulator-5554</code></li>
|
|
|
|
Here's an example serial number: <code>emulator-5554</code></li>
|
|
|
|
<li>State — The connection state of the instance may be one of the following:
|
|
|
|
<li>State — The connection state of the instance may be one of the following:
|
|
|
|
<ul>
|
|
|
|
<ul>
|
|
|
|
<li><code>offline</code> — the instance is not connected to adb or is not responding.</li>
|
|
|
|
<li><code>offline</code> — the instance is not connected to adb or is not responding.</li>
|
|
|
|
<li><code>device</code> — the instance is now connected to the adb server. Note that this state does not
|
|
|
|
<li><code>device</code> — the instance is now connected to the adb server. Note that this state does not
|
|
|
|
imply that the Android system is fully booted and operational, since the instance connects to adb
|
|
|
|
imply that the Android system is fully booted and operational, since the instance connects to adb
|
|
|
|
while the system is still booting. However, after boot-up, this is the normal operational state of
|
|
|
|
while the system is still booting. However, after boot-up, this is the normal operational state of
|
|
|
|
an emulator/device instance.</li>
|
|
|
|
an emulator/device instance.</li>
|
|
|
|
<li><code>no device</code> — there is no emulator/device connected.
|
|
|
|
<li><code>no device</code> — there is no emulator/device connected.
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
<p>The output for each instance is formatted like this: </p>
|
|
|
|
<p>The output for each instance is formatted like this: </p>
|
|
|
|
|
|
|
|
|
|
|
|
<pre class="no-pretty-print">[serialNumber] [state]</pre>
|
|
|
|
<pre class="no-pretty-print">[serialNumber] [state]</pre>
|
|
|
|
|
|
|
|
|
|
|
|
<p>Here's an example showing the <code>devices</code> command and its output:</p>
|
|
|
|
<p>Here's an example showing the <code>devices</code> command and its output:</p>
|
|
|
|
|
|
|
|
|
|
|
|
<pre class="no-pretty-print">adb devices
|
|
|
|
<pre class="no-pretty-print">adb devices
|
|
|
|
List of devices attached
|
|
|
|
List of devices attached
|
|
|
|
emulator-5554 device
|
|
|
|
emulator-5554 device
|
|
|
|
emulator-5556 device
|
|
|
|
emulator-5556 device
|
|
|
|
@@ -323,13 +324,13 @@ emulator-5558 device</pre>
|
|
|
|
when issuing adb commands. To do so, use the <code>-s</code> option in the commands. The usage
|
|
|
|
when issuing adb commands. To do so, use the <code>-s</code> option in the commands. The usage
|
|
|
|
for the <code>-s</code> option is:</p>
|
|
|
|
for the <code>-s</code> option is:</p>
|
|
|
|
|
|
|
|
|
|
|
|
<pre class="no-pretty-print">adb -s <serialNumber> <command> </pre>
|
|
|
|
<pre class="no-pretty-print">adb -s <serialNumber> <command> </pre>
|
|
|
|
|
|
|
|
|
|
|
|
<p>As shown, you specify the target instance for a command using its adb-assigned serial number.
|
|
|
|
<p>As shown, you specify the target instance for a command using its adb-assigned serial number.
|
|
|
|
You can use the <code>devices</code> command to obtain the serial numbers of running
|
|
|
|
You can use the <code>devices</code> command to obtain the serial numbers of running
|
|
|
|
emulator/device instances. For example: </p>
|
|
|
|
emulator/device instances. For example: </p>
|
|
|
|
|
|
|
|
|
|
|
|
<pre class="no-pretty-print">adb -s emulator-5556 install helloWorld.apk</pre>
|
|
|
|
<pre class="no-pretty-print">adb -s emulator-5556 install helloWorld.apk</pre>
|
|
|
|
|
|
|
|
|
|
|
|
<p>Note that, if you issue a command without specifying a target emulator/device instance
|
|
|
|
<p>Note that, if you issue a command without specifying a target emulator/device instance
|
|
|
|
while multiple devices are available, adb generates an error.
|
|
|
|
while multiple devices are available, adb generates an error.
|
|
|
|
@@ -408,11 +409,11 @@ at <code>/system/bin/...</code>
|
|
|
|
the adb remote shell on the emulator/device. To issue a single command without entering a
|
|
|
|
the adb remote shell on the emulator/device. To issue a single command without entering a
|
|
|
|
remote shell, use the <code>shell</code> command like this: </p>
|
|
|
|
remote shell, use the <code>shell</code> command like this: </p>
|
|
|
|
|
|
|
|
|
|
|
|
<pre class="no-pretty-print">adb [-d|-e|-s <serialNumber>] shell <shell_command></pre>
|
|
|
|
<pre class="no-pretty-print">adb [-d|-e|-s <serialNumber>] shell <shell_command></pre>
|
|
|
|
|
|
|
|
|
|
|
|
<p>Or enter a remote shell on an emulator/device like this:</p>
|
|
|
|
<p>Or enter a remote shell on an emulator/device like this:</p>
|
|
|
|
|
|
|
|
|
|
|
|
<pre class="no-pretty-print">adb [-d|-e|-s <serialNumber>] shell</pre>
|
|
|
|
<pre class="no-pretty-print">adb [-d|-e|-s <serialNumber>] shell</pre>
|
|
|
|
|
|
|
|
|
|
|
|
<p>When you are ready to exit the remote shell, press CTRL+D or type
|
|
|
|
<p>When you are ready to exit the remote shell, press CTRL+D or type
|
|
|
|
<code>exit</code>. </p>
|
|
|
|
<code>exit</code>. </p>
|
|
|
|
@@ -441,8 +442,8 @@ adb shell am start -a android.intent.action.VIEW
|
|
|
|
<p class="table-caption"><strong>Table 2.</strong> Available activity manager commands</p>
|
|
|
|
<p class="table-caption"><strong>Table 2.</strong> Available activity manager commands</p>
|
|
|
|
<table>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<th>Command</th>
|
|
|
|
<th>Command</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Description</th>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
@@ -843,8 +844,8 @@ adb shell pm uninstall com.example.MyApp
|
|
|
|
<p class="table-caption"><strong>Table 3.</strong> Available package manager commands.</p>
|
|
|
|
<p class="table-caption"><strong>Table 3.</strong> Available package manager commands.</p>
|
|
|
|
<table>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<th>Command</th>
|
|
|
|
<th>Command</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Description</th>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
@@ -1155,9 +1156,9 @@ application and sends 500 pseudo-random events to it.</p>
|
|
|
|
<p class="table-caption"><strong>Table 4.</strong> Some other adb shell commands</p>
|
|
|
|
<p class="table-caption"><strong>Table 4.</strong> Some other adb shell commands</p>
|
|
|
|
<table>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<th>Shell Command</th>
|
|
|
|
<th>Shell Command</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Comments</th>
|
|
|
|
<th>Comments</th>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
|