Home | History | Annotate | Download | only in help

Lines Matching full:code

48 <p>You can find the {@code adb} tool in {@code &lt;sdk&gt;/platform-tools/}.</p>
94 attached, you need to use the <code>-d</code>, <code>-e</code>, or <code>-s</code>
114 <td><code>-d</code></td>
120 <td><code>-e</code></td>
126 <td><code>-s&nbsp;&lt;serialNumber&gt;</code></td>
134 <td><code>devices</code></td>
140 <td><code>help</code></td>
146 <td><code>version</code></td>
153 <td ><code>logcat&nbsp;[option] [filter-specs]</code></td>
159 <td><code>bugreport</code></td>
160 <td>Prints <code>dumpsys</code>, <code>dumpstate</code>, and <code>logcat</code> data to the screen, for the purposes of bug reporting. </td>
165 <td><code>jdwp</code></td>
167 <td>You can use the <code>forward jdwp:&lt;pid&gt;</code> port-forwarding specification to connect to a specific JDWP process. For example: <br>
168 <code>adb forward tcp:8000 jdwp:472</code><br>
169 <code>jdb -attach localhost:8000</code></p>
175 <td><code>install&nbsp;&lt;path-to-apk&gt;</code></td>
181 <td><code>pull&nbsp;&lt;remote&gt;&nbsp;&lt;local&gt;</code></td>
187 <td><code>push&nbsp;&lt;local&gt;&nbsp;&lt;remote&gt;</code></td>
194 <td><code>forward&nbsp;&lt;local&gt;&nbsp;&lt;remote&gt;</code></td>
197 <ul><li><code>tcp:&lt;portnum&gt;</code></li>
198 <li><code>local:&lt;UNIX domain socket name&gt;</code></li>
199 <li><code>dev:&lt;character device name&gt;</code></li>
200 <li><code>jdwp:&lt;pid&gt;</code></li></ul>
205 <td><code>ppp&nbsp;&lt;tty&gt;&nbsp;[parm]...</code></td>
208 <li><code>&lt;tty&gt;</code> &mdash; the tty for PPP stream. For example <code>dev:/dev/omap_csmi_ttyl</code>. </li>
209 <li><code>[parm]... </code> &mdash; zero or more PPP/PPPD options, such as <code>defaultroute</code>, <code>local</code>, <code>notty</code>, etc.</li></ul>
217 <td><code>get-serialno</code></td>
223 <td><code>get-state</code></td>
229 <td><code>wait-for-device</code></td>
230 <td>Blocks execution until the device is online &mdash; that is, until the instance state is <code>device</code>.</td>
234 Note that this command does <em>not</em> cause adb to wait until the entire system is fully booted. For that reason, you should not prepend it to other commands that require a fully booted system. As an example, the <code>install</code> requires the Android package manager, which is available only after the system is fully booted. A command such as
238 would issue the <code>install</code> command as soon as the emulator or device instance connected to the adb server, but before the Android system was fully booted, so it would result in an error. </td>
245 <td><code>start-server</code></td>
251 <td><code>kill-server</code></td>
260 <td><code>shell</code></td>
266 <td><code>shell&nbsp;[shellCommand]</code></td>
283 <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>
291 console port number. The format of the serial number is <code>&lt;type&gt;-&lt;consolePort&gt;</code>.
292 Here's an example serial number: <code>emulator-5554</code></li>
295 <li><code>offline</code> &mdash; the instance is not connected to adb or is not responding.</li>
296 <li><code>device</code> &mdash; the instance is now connected to the adb server. Note that this state does not
300 <li><code>no device</code> &mdash; there is no emulator/device connected.
309 <p>Here's an example showing the <code>devices</code> command and its output:</p>
325 when issuing adb commands. To do so, use the <code>-s</code> option in the commands. The usage
326 for the <code>-s</code> option is:</p>
331 You can use the <code>devices</code> command to obtain the serial numbers of running
340 simply use the {@code -e} option to send commands to the emulator. Likewise if there's multiple
341 devices but only one hardware device attached, use the {@code -d} option to send commands to
348 <p>You can use adb to copy an application from your development computer and install it on an emulator/device instance. To do so, use the <code>install</code> command. With the command, you must specify the path to the .apk file that you want to install:</p>
364 <p>You can use the <code>forward</code> command to set up arbitrary port forwarding &mdash; forwarding of requests on a specific host port to a different port on an emulator/device instance. Here's how you would set up forwarding of host port 6100 to emulator/device port 7100:</p>
375 <p>You can use the adb commands <code>pull</code> and <code>push</code> to copy files to
376 and from an emulator/device instance. Unlike the <code>install</code> command,
377 which only copies an APK file to a specific location, the <code>pull</code> and <code>push</code>
387 <p>In the commands, <code>&lt;local&gt;</code> and <code>&lt;remote&gt;</code> refer to the
404 at <code>/system/bin/...</code>
406 code am}) and
407 <a href="#pm">package manager</a> ({@code pm}).</p>
409 <p>You can use the <code>shell</code> command to issue commands, with or without entering
411 remote shell, use the <code>shell</code> command like this: </p>
420 <code>exit</code>. </p>
428 <p>Within an adb shell, you can issue commands with the activity manager ({@code am}) tool to
451 <td><code>
453 </code></td>
454 <td>Start an {@link android.app.Activity} specified by {@code &lt;INTENT>}. <p>See the
458 <li>{@code -D}: Enable debugging.
459 <li>{@code -W}: Wait for launch to complete.
460 <li>{@code --start-profiler &lt;FILE>}: Start profiler and send results to {@code &lt;FILE>}.
461 <li>{@code -P &lt;FILE>}: Like <code>--start-profiler</code>,
463 <li>{@code -R}: Repeat the activity launch {@code &lt;COUNT>} times. Prior to each repeat,
465 <li>{@code -S}: Force stop the target app before starting the activity.
466 <li>{@code --opengl-trace}: Enable tracing of OpenGL functions.
467 <li>{@code --user &lt;USER_ID> | current}: Specify which user to run as; if not
474 <td><code>
476 </code></td>
477 <td>Start the {@link android.app.Service} specified by {@code &lt;INTENT>}. <p>See the
481 <li>{@code --user &lt;USER_ID> | current}: Specify which user to run as; if not
488 <td><code>
490 </code></td>
491 <td>Force stop everything associated with {@code &lt;PACKAGE>} (the app's package name).
496 <td><code>
498 </code></td>
499 <td> Kill all processes associated with {@code &lt;PACKAGE>}
505 <li>{@code --user &lt;USER_ID> | all | current}: Specify user whose processes to kill;
512 <td><code>
514 </code></td>
520 <td><code>
522 </code></td>
527 <li>{@code [--user &lt;USER_ID> | all | current]}: Specify which user to send to; if not
534 <td><code>
536 </code></td>
538 Typically the target {@code &lt;COMPONENT>}
539 is the form {@code &lt;TEST_PACKAGE>/&lt;RUNNER_CLASS>}. <p>Options are:
541 <li>{@code -r}: Print raw results (otherwise decode
542 {@code &lt;REPORT_KEY_STREAMRESULT>}). Use with
543 {@code [-e perf true]} to generate raw output for performance measurements.
545 <li>{@code -e &lt;NAME> &lt;VALUE>}: Set argument {@code &lt;NAME>} to {@code &lt;VALUE>}.
546 For test runners a common form is {@code
549 <li>{@code -p &lt;FILE>}: Write profiling data to {@code &lt;FILE>}.
551 <li>{@code -w}: Wait for instrumentation to finish before returning. Required for
554 <li>{@code --no-window-animation}: Turn off window animations while running.
555 <li>{@code --user &lt;USER_ID> | current}: Specify which user instrumentation runs in;
563 <td><code>
565 </code></td>
566 <td>Start profiler on {@code &lt;PROCESS>}, write results to {@code &lt;FILE>}.
571 <td><code>
573 </code></td>
574 <td>Stop profiler on {@code &lt;PROCESS>}.
579 <td style="white-space:nowrap"><code>
581 </code></td>
582 <td>Dump the heap of {@code &lt;PROCESS>}, write to {@code &lt;FILE>}. <p>Options are:
584 <li>{@code --user [&lt;USER_ID>|current]}: When supplying a process name,
586 <li>{@code -n}: Dump native heap instead of managed heap.
592 <td><code>
594 </code></td>
595 <td>Set application {@code &lt;PACKAGE>} to debug. <p>Options are:
597 <li>{@code -w}: Wait for debugger when application starts.
598 <li>{@code --persistent}: Retain this value.
604 <td><code>
606 </code></td>
607 <td>Clear the package previous set for debugging with {@code set-debug-app}.
612 <td><code>
614 </code></td>
617 <li>{@code --gdb}: Start gdbserv on the given port at crash/ANR.
623 <td><code>
625 </code></td>
627 compatibility</a> mode of {@code &lt;PACKAGE>}.</p>
632 <td><code>
634 </code></td>
638 <p>Example:<br><code>am display-size 1280x800</code>
643 <td><code>
645 </code></td>
649 <p>Example:<br><code>am display-density 480</code>
654 <td><code>
656 </code></td>
663 <td><code>
665 </code></td>
666 <td>Print the given intent specification as an {@code intent:} URI. <p>See the
682 <p>For activity manager commands that take a {@code &lt;INTENT>} argument, you can
686 <dt>{@code -a &lt;ACTION>}</dt>
690 <dt>{@code -d &lt;DATA_URI>}</dt>
694 <dt>{@code -t &lt;MIME_TYPE>}</dt>
698 <dt>{@code -c &lt;CATEGORY>}</dt>
701 <dt>{@code -n &lt;COMPONENT>}</dt>
705 <dt>{@code -f &lt;FLAGS>}</dt>
709 <dt>{@code --esn &lt;EXTRA_KEY>}</dt>
712 <dt>{@code -e|--es &lt;EXTRA_KEY> &lt;EXTRA_STRING_VALUE>}</dt>
715 <dt>{@code --ez &lt;EXTRA_KEY> &lt;EXTRA_BOOLEAN_VALUE>}</dt>
718 <dt>{@code --ei &lt;EXTRA_KEY> &lt;EXTRA_INT_VALUE>}</dt>
721 <dt>{@code --el &lt;EXTRA_KEY> &lt;EXTRA_LONG_VALUE>}</dt>
724 <dt>{@code --ef &lt;EXTRA_KEY> &lt;EXTRA_FLOAT_VALUE>}</dt>
727 <dt>{@code --eu &lt;EXTRA_KEY> &lt;EXTRA_URI_VALUE>}</dt>
730 <dt>{@code --ecn &lt;EXTRA_KEY> &lt;EXTRA_COMPONENT_NAME_VALUE>}</dt>
734 <dt>{@code --eia &lt;EXTRA_KEY> &lt;EXTRA_INT_VALUE>[,&lt;EXTRA_INT_VALUE...]}</dt>
737 <dt>{@code --ela &lt;EXTRA_KEY> &lt;EXTRA_LONG_VALUE>[,&lt;EXTRA_LONG_VALUE...]}</dt>
740 <dt>{@code --efa &lt;EXTRA_KEY> &lt;EXTRA_FLOAT_VALUE>[,&lt;EXTRA_FLOAT_VALUE...]}</dt>
743 <dt>{@code --grant-read-uri-permission}</dt>
746 <dt>{@code --grant-write-uri-permission}</dt>
749 <dt>{@code --debug-log-resolution}</dt>
752 <dt>{@code --exclude-stopped-packages}</dt>
755 <dt>{@code --include-stopped-packages}</dt>
758 <dt>{@code --activity-brought-to-front}</dt>
761 <dt>{@code --activity-clear-top}</dt>
764 <dt>{@code --activity-clear-when-task-reset}</dt>
767 <dt>{@code --activity-exclude-from-recents}</dt>
770 <dt>{@code --activity-launched-from-history}</dt>
773 <dt>{@code --activity-multiple-task}</dt>
776 <dt>{@code --activity-no-animation}</dt>
779 <dt>{@code --activity-no-history}</dt>
782 <dt>{@code --activity-no-user-action}</dt>
785 <dt>{@code --activity-previous-is-top}</dt>
788 <dt>{@code --activity-reorder-to-front}</dt>
791 <dt>{@code --activity-reset-task-if-needed}</dt>
794 <dt>{@code --activity-single-top}</dt>
797 <dt>{@code --activity-clear-task}</dt>
800 <dt>{@code --activity-task-on-home}</dt>
803 <dt>{@code --receiver-registered-only}</dt>
806 <dt>{@code --receiver-replace-pending}</dt>
809 <dt>{@code --selector}</dt>
810 <dd>Requires the use of {@code -d} and {@code -t} options to set the intent data and type.
812 <dt>{@code &lt;URI> &lt;COMPONENT> &lt;PACKAGE>}</dt>
832 <p>Within an adb shell, you can issue commands with the package manager ({@code pm}) tool to
853 <td><code>
855 </code></td>
857 those whose package name contains the text in {@code &lt;FILTER>}. <p>Options:
859 <li>{@code -f}: See their associated file.
860 <li>{@code -d}: Filter to only show disabled packages.
861 <li>{@code -e}: Filter to only show enabled packages.
862 <li>{@code -s}: Filter to only show system packages.
863 <li>{@code -3}: Filter to only show third party packages.
864 <li>{@code -i}: See the installer for the packages.
865 <li>{@code -u}: Also include uninstalled packages.
866 <li>{@code --user &lt;USER_ID>}: The user space to query.
872 <td><code>
874 </code></td>
880 <td><code>
882 </code></td>
884 those in {@code &lt;GROUP>}. <p>Options:
886 <li>{@code -g}: Organize by group.
887 <li>{@code -f}: Print all information.
888 <li>{@code -s}: Short summary.
889 <li>{@code -d}: Only list dangerous permissions.
890 <li>{@code -u}: List only the permissions users will see.
896 <td><code>
898 </code></td>
901 <li>{@code -f}: List the APK file for the test package.
902 <li>{@code &lt;TARGET_PACKAGE>}: List test packages for only this app.
908 <td><code>
910 </code></td>
916 <td><code>
918 </code></td>
924 <td><code>
926 </code></td>
932 <td><code>
934 </code></td>
935 <td>Print the path to the APK of the given {@code &lt;PACKAGE>}.
940 <td><code>
942 </code></td>
943 code &lt;PATH>}) to the system. <p>Options:
945 <li>{@code -l}: Install the package with forward lock.
946 <li>{@code -r}: Reinstall an exisiting app, keeping its data.
947 <li>{@code -t}: Allow test APKs to be installed.
948 <li>{@code -i &lt;INSTALLER_PACKAGE_NAME>}: Specify the installer package name.
949 <li>{@code -s}: Install package on the shared mass storage (such as sdcard).
950 <li>{@code -f}: Install package on the internal system memory.
951 <li>{@code -d}: Allow version code downgrade.
957 <td><code>
959 </code></td>
962 <li>{@code -k}: Keep the data and cache directories around after package removal.
968 <td><code>
970 </code></td>
976 <td><code>
978 </code></td>
984 <td><code>
986 </code></td>
992 <td style="white-space:nowrap"><code>
994 </code></td>
997 <li>{@code --user &lt;USER_ID>}: The user to disable.
1003 <td><code>
1005 </code></td>
1013 <td><code>
1015 </code></td>
1023 <td><code>
1025 </code></td>
1028 <li>{@code 0}: Auto&mdash;Let system decide the best location.
1029 <li>{@code 1}: Internal&mdash;install on internal device storage.
1030 <li>{@code 2}: External&mdash;install on external media.
1038 <td><code>
1040 </code></td>
1043 <li>{@code 0 [auto]}: Lets system decide the best location
1044 <li>{@code 1 [internal]}: Installs on internal device storage
1045 <li>{@code 2 [external]}: Installs on external media
1051 <td><code>
1053 </code></td>
1059 <td><code>
1061 </code></td>
1067 <td><code>
1069 </code></td>
1070 <td>Create a new user with the given {@code &lt;USER_NAME>},
1076 <td><code>
1078 </code></td>
1079 <td>Remove the user with the given {@code &lt;USER_IDENTIFIER>},
1085 <td><code>
1087 </code></td>
1105 <code>sqlite3</code> tool includes many useful commands, such as
1106 <code>.dump</code> to print out the contents of a table and
1107 <code>.schema</code> to print the SQL CREATE statement for an existing table.
1110 <p>To use <code>sqlite3</code>, enter a remote shell on the emulator instance, as described above,
1111 then invoke the tool using the <code>sqlite3</code> command. Optionally, when invoking
1112 <code>sqlite3</code> you can specify the full path to the database you want to explore.
1114 <code><span chatdir="1"><span chatindex="259474B4B070F261">/data/data/<em>&lt;package_name&gt;</em>/databases</span></span>/</code>. </p>
1125 <p>Once you've invoked <code>sqlite3</code>, you can issue <code>sqlite3</code> commands in the
1126 shell. To exit and return to the adb remote shell, use <code>exit</code> or <code>CTRL+D</code>.
1133 <p>The {@code screenrecord} command is a shell utility for recording the display of a device as you
1138 <p>To use the {@code screenrecord} from the command line, type the following:
1145 at three minutes or the time limit set by {@code --time-limit}.</p>
1148 {@code pull} command to download the file from the device:<p>
1158 <p>The {@code screenrecord} utility can record at any supported resolution and bit rate you
1162 <p>There are some known limitations of the {@code screenrecord} utility that you should be aware
1174 <p class="table-caption"><strong>Table 4.</strong> {@code screenrecord} options</p>
1183 <td><code>--help</code>
1190 <code>--size &lt;WIDTHxHEIGHT&gt;</code>
1192 <td>Sets the video size, for example: {@code 1280x720}. The default value is the device's main
1198 <td><code>--bit-rate &lt;RATE&gt;</code></td>
1207 <td><code>--time-limit &lt;TIME&gt;</code></td>
1213 <td><code>--rotate</code></td>
1218 <td><code>--verbose</code></td>
1266 <td><code>dumpsys</code></td>
1273 <td><code>dumpstate</code></td>
1278 <td><code>logcat&nbsp;[option]...&nbsp;[filter-spec]...</code></td>
1283 <td><code>dmesg</code></td>
1288 <td><code>start</code></td>
1294 <td><code>stop</code></td>
1316 <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.</p>
1318 <p>You can use the <code>logcat</code> command to view and follow the contents of the system's log buffers. The general usage is:</p>
1322 <p>You can use the <code>logcat</code> command from your development computer or from a remote adb shell in an emulator/device instance. To view log output in your development computer, you use</p>
1340 <p>To stop the adb server, use the <code>kill-server</code> command.