Android adb command plot

Source: Internet
Author: User
Tags unix domain socket root access

have done so long development and management, in the command is always self-seeing, often ignoring the sharing process on its command, so now a little bit of time on its command of the relevant operation to a simple literacy, but also the system through this way to the fishing and not fish, well, I show in a graphic way, Of course, my habit is anything to look at the Help document or command, today we have to explain the ADB command in the command line can be ordered to help to understand the details, not much to say, first:

The above is to use Help to display its related command instructions, of course, if your English is good enough, in fact, these are very simple, of course, if you are not too accustomed to see these English descriptions, then I would like to assist in dealing with such a problem, well, I will be the most initial understanding of the way to translate and explain it Ok:

Android Debug Bridge Version 1.0.29
This is a 1.0.29 version of the Android Debug board.

-d-directs command to the only connected USB device

Through this direct command simply to connect the USB device
Returns an error if more than one USB device is present.

An error message is returned if multiple USB devices are present at the same time
-e-directs command to the only running emulator.

Use this command symbol directly to run the emulator
Returns an error if more than one emulator is running.

If there is more than one emulator running at the same time, an error message is currently returned
-S <serial number>-directs command to the USB device or emulator with

The given serial number. Overrides android_serial
environment variable.

The

uses this direct command to display the serial number of its USB device or emulator, which makes its environment variable variable when overwritten with each other
 -p <product name or path>    -Simple product Name like ' sooner ' or
                          &NBSP ;      a Relative/absolute path to a product
                &NBSP ;                out directory like ' Out/target/product/sooner '.
                                  If-p is not specified, the Android_product_out
                    & nbsp            environment variable is used, which must
          &N Bsp                      be an absolute path.

This command displays the name of its product, such as "sooner", or relative to the absolute output path of the product like "Out/target/product/sooner", if-p is not specified, the ANDROID_PRODUCT_OUT environment variable is used. But it must be an absolute path.
Devices-list All connected devices

Use this command to list all connected devices
Connect Port 5555 is used by default if No. port number is specified.

Connecting devices via the default port of TCP/IP 5555来
disconnect [Port 5555 is used by default if No. port number is specified.
Using This command with no additional arguments
Would disconnect from all connected TCP/IP devices.

Use this command to disconnect a device connection from TCP/IP, which is specified as 5555 by default when no port number is specified, and using this command will disconnect all connected devices from TCP/IP without having to add parameters

Device commands:

Device command:
ADB push <local> <remote>-copy File/dir to device
Push command: Copy a file or directory into the device

ADB pull <remote> [<local>]-copy file/dir from device

Pull command: That is, copy a file or directory into the device
ADB sync [<directory>]-copy host->device only if changed
(-L means list but don ' t copy)
(see ' adb help all ')

Sync: Copy the contents of the host into the device, only the device changes when the content of the operation to synchronize, there is a description in parentheses: I mean the list but do not need to copy, can refer to help all
ADB shell-run remote shell interactively

Shell: Run the remote Shell to interact with it
ADB shell <command>-run Remote shell command

Shell: Run remote shell command directly
ADB EMU <command>-run Emulator console command

EMU: Run simulator monitoring Info Panel command
ADB logcat [<filter-spec>]-View device log

Read the device log
ADB forward <local> <remote>-forward socket connections

Forward socket connections
Forward specs is one of:

One of the criteria shown in the forward specification is:
Tcp:<port>

TCP Port number
Localabstract:<unix Domain Socket name>
Local abstraction: The socket name of a UNIX domain name

Localreserved:<unix Domain Socket name>

Local Service: UNIX domain name/socket names
Localfilesystem:<unix Domain Socket name>

Local file system: UNIX domain name/socket names
Dev:<character Device name>

Device: Character device name
Jdwp:<process pid> (remote only)

Remote Process ID
ADB jdwp-list PIDs of processes hosting a JDWP transport

Lists the associated process IDs for the transfer of a Java Debug wireless protocol for the host process

Said JDWP, I simply explained to it, the explanation is JDWP, JDWP's full write is: Java Debug wire Protocol: The Java Debugger Wireless protocol, which defines the debugger (Debugger) and the Debugged Java Virtual machine (target VM) The communication protocol between, here, I would like to explain the following: Debugger and Target vm,target VM running the program we want to debug, it is not the same as the Java virtual machine generally running, just loaded the Agent JDWP on startup to have debugging capabilities. And debugger is our familiar debugger, which sends commands to the running target VM to get the status of the target VM runtime and control the execution of the Java program. The Debugger and Target VMs run separately in their own process, and the communication protocol between them is JDWP. Unlike many other protocols, JDWP only defines the format of the data transfer, but does not specify a specific transmission mode. This means that a JDWP implementation can work in different modes of transmission without having to make any modifications (in detail in the JDWP transport interface). JDWP is language-independent. Theoretically, we can use any language to implement JDWP. We note, however, that at both ends of the JDWP are target VMS and debugger. Target VM side, the JDWP module must be loaded in the form of the Agent library when the Java Virtual machine is started, and it must implement various debug functions through the JVMTI interface provided by the Java Virtual machine, so it must be written in C + + language. And the debugger end there is no such restrictions, can be written in any language, as long as compliance with the JDWP specification. JDI (Java Debug Interface) contains a Java JDWP debugger implementation (JDI will be covered in the next article in the series), and the Debug tool jdb in the JDK is also using JDI to complete its debugging functions. The JDWP agent described above plays a role in debugging as shown in:

In fact, with a simple analysis of its protocol, we can understand the simple process of the handshake Protocol:

Finally understand the structure of it:

Well, from the above we understand the relevant information of its JDWP, more detailed information and operation please in Google detailed inquiry and understand it.

ADB install [-l] [-r] [-s] <file>-Push This package file to the device and install it
('-l ' means forward-lock the app)
('-R ' means reinstall the app, keeping its data)
('-s ' means install on SD card instead of internal storage)

With this command to install its packaged apk into the device,-l means that the forward lock periodic app,-r means that the app needs to be reinstalled and, of course, the data must be kept,-s means that it is installed into the SD card
adb uninstall [-K] <package>-remove this app from the device
('-K ' means keep the data and cache directories)

With this command to uninstall its installed apk, that is, remove the current app from the device's package,-K means to keep the data domain cache directory
ADB Bugreport-return all information from the device
That should is included in a bug report.

This command can be used to output and display the information it has debugged (information about the device).

ADB backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
-Write an archive of the device ' s data to <file>.
If no-f option is supplied and the data is written
To ' Backup.ab ' in the current directory.
(-apk|-noapk enable/disable Backup of the. APKs themselves
in the archive; The default is noapk.)
(-shared|-noshared enable/disable Backup of the device ' s
Shared STORAGE/SD card contents; The default is noshared.)
(-all means to installed applications)
(-system|-nosystem toggles Whether-all automatically includes
System applications; The default is to include system apps)
(<packages...> is the list of applications to being backed up. If
The-all or-shared Flags is passed, then the
List is optional. Applications explicitly given on the
Command line'll be included even If-nosystem would
Ordinarily cause them to be omitted.)
With this command, you can make a backup of its contents,

ADB restore <file>-restore device contents from the <file> backup archive

Archive files to which they are backed up can be re-stored on the device's contents
ADB help-show this Help message

Display Help information
ADB version-show version num

Show to version number

Scripting

Script
ADB wait-for-device-block until device is online

Waiting period devices know when the device is online
ADB start-server-ensure that there is a server running

Start their service
ADB Kill-server-kill the server if it is running

The service to which it is running is killed by this command
ADB Get-state-prints:offline | bootloader | Device

Get the status of their devices
ADB get-serialno-prints: <serial-number>

Get a series of serial number information
ADB status-window-continuously print device status for a specified device

Continuous printing of specified device status
ADB remount-remounts The/system partition on the device read-write
Re-install the read and write of its device

ADB reboot [Bootloader|recovery]-reboots the device, optionally into the bootloader or recovery program
Reload or go to recovery program, etc.

ADB reboot-bootloader-reboots the device into the bootloader

Load the device on which it is restarted
ADB root-restarts the adbd daemon with root permissions

Root Access after reboot
ADB usb-restarts the ADBD daemon listening on USB

Reboot to Listener USB
ADB TCPIP <port>-Restarts the adbd daemon listening on TCP on the specified port

Restart TCP to listen for the specified TCP port
Networking

Internet
ADB PPP <tty> [parameters]-Run PPP over USB.

Note:you should not automatically start a PPP connection.
<tty> refers to the TTY for PPP stream. Eg. Dev:/dev/omap_csmi_tty1
[Parameters]-Eg. Defaultroute Debug Dump Local Notty Usepeerdns


adb sync notes:adb sync [<directory>]
<localdir> can be interpreted in several ways:


-If <directory> is not specified, Both/system and/data partitions would be updated.


-If It is ' system ' or ' data ', only the corresponding partition
is updated.


Environmental variables:
Adb_trace-print Debug information. A Comma separated list of the following values
1 or all, ADB, sockets, packets, RWX, USB, Sync, sysdeps, transport, JDWP
Android_serial-the SERIAL number to connect to. -S takes priority over this if given.
Android_log_tags-when used with the LOGCAT option, only these debug TAGS is printed.

The above part because of the time problem will not translate and understand, in fact, the following a few sentences are very good understanding, oneself also try to do it,

Here's a simple example:

Display log: adb logcat | More

List devices: ADB devices

OK, the above is a simple two command, you can carry out the relevant parameters according to the actual situation to verify its command, well, I hope to give you a certain reference and learning ....
Url:http://greatverve.cnblogs.com/archive/2012/04/23/android-adb.html

Android adb command plot

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.