Android Note adb command parsing 1

Source: Internet
Author: User
Tags unix domain socket

Because I study Android also quite a long time, has kept the diary in Evernote, because just leave relatively idle plan to put Evernote in the log over and over again published to share online.


To use ADB directly in the cmd command, you need to configure the environment variable: directory Xxx\sdk\platform-tools

View the ADB-HELP help command to print out the following:

Android Debug Bridge version 1.0.31 <!--android Debug bridging build number:1.0.31-->

-a-directs adb to listen on all interfaces for a connection
<!---a parameter, which instructs the ADB to listen on all interfaces of the connection. -

-d-directs command to the only connected USB device
Returns an error if more than one USB device is present.
<!---D parameter to instruct the command to connect only USB devices
If multiple USB devices exist at the same time, an error will be returned.
-

-e-directs command to the only running emulator.
Returns an error if more than one emulator is running.
<!---e parameter, indicating that only the emulator in operation is connected--
If more than one emulator is running, an error is returned.
-

-S <specific device>-directs command to the device or emulator with the given
Serial number or qualifier. Overrides android_serial environment variable.

<!---S <specific device> (given device) parameter, <specific Device> according to the given serial number or modifier, the command is assigned to that device or emulator.

Overwrite the android_serial environment variable.
-

-P <product Name or path>-simple product name like ' sooner ', or
A relative/absolute path to a product out of directory like ' Out/target/product/sooner '.

If-p is isn't specified, the ANDROID_PRODUCT_OUT environment variable is used,
Which must is an absolute path.


<!---P <product name or path> (product name or path) parameter to display the name of its product, such as: "Sooner", or
is a relative/absolute product output path, such as: "Out/target/product/sooner".
If-p is not specified, the ANDROID_PRODUCT_OUT environment variable is used, which must be an absolute path.

-

-h-name of ADB server host (Default:localhost)

<!---H parameter, indicating the ADB service host name--

-p-port of ADB server (default:5037)
<!---P parameter, indicating the ADB service port number--

devices [-l]-list all connected devices
('-l ' 'll also list device qualifiers)

<!--adb devices [-l] to list all connected devices by this command
Adding '-l ' parameters will list device modifiers
EG:ADB devices-l
List of devices attached
da0b232e Device Product:jflteuc model:gt_i9500 Device:jflteatt
-

Connect Port 5555 is used by default if No. port number is specified.

<!--ADB connect -

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.

<!--adb disconnect [If no port number is specified, the default 5555 port is used.
Using this command without adding additional parameters will disconnect all TCP/IP connected devices.
-

Device commands:
<!--device Commands--
ADB push [-p] <local> <remote>
-Copy File/dir to device
('-P ' to display the transfer progress)

<!--adb push [-p] <local> <remote> command: Copy a file/directory to the device--
-P parameter specifies that the transmission progress is displayed
-

ADB pull [-p] [-a] <remote> [<local>]
-Copy File/dir from device
('-P ' to display the transfer progress)
('-a ' means copy timestamp and mode)

<!--adb pull [-p] [-a] <remote> [<local>] Command: Copy a file/directory from the device
-P parameter specifies that the transmission progress is displayed
-A refers to the time stamp and pattern of the copy.
-

ADB sync [<directory>]-copy host->device only if changed
(-L means list but don ' t copy)
(see ' adb help all ')

<!--adb sync [<directory>] command: Copy the host content to the device and synchronize its contents only after the device content has changed.
-L means list but not copy
Refer to the ADB help all command.
-

ADB shell-run remote shell interactively
<!--adb shell command: Runs interactively with the remote shell.
-

ADB shell <command>-run Remote shell command
<!--adb Shell <command> command: Run remote shell command

such as: adb shell ls-l
-

ADB EMU <command>-run Emulator console command

<!--adb EMU <command> Command: Run Simulator console command
-

ADB logcat [<filter-spec>]-View device log

<!--adb logcat command: View device logs
-

ADB forward--list-list all forward socket connections.
The format is a list of lines with the following format:
<serial> "<local>" <remote> "\ n"

<!--adb forward--list command: Lists all forwarded socket connections. The
format is a list of rows, formatted as follows:
<serial> "<local>" <remote> "\ n"
-->

ADB forward <local> <remote>-forward socket connections
forward specs is one of:
<!--adb Forwar D <local> <remote> commands the user to forward the specified port of the PC <local> to the device specified port <remote>. The forwarding specifications for the
forward socket connection are as follows:-->
Tcp:<port>
<!--tcp:< port number >-->
Localabstract:<unix Domain socket NAME>
<!--localabstract:<unix domain socket name >-->
Localreserved:<unix domain socket Name>
<!--localreserved:<unix domain socket name >-->
Localfilesystem:<unix domain socket NAME>
<!--localfilesystem:<unix domain socket name >-->,
Dev:<character device name>
<!--dev:< character device name >-->
jdwp:<process pid> (remote only)
<!--jdwp:< remote process number >-->
<!--
Note:
Unix Domain Socket
See: Http://zh.wikipedia.org/wiki/Unix_domain_socket
jdwp
See also: Http://zh.wikipedia.org/wiki/JPDA

1.eg:
ADB forward tcp:6100 tcp:7100//PC All 6100-port communication data will be redirected to the phone-side/Simulator 7100-Port server
2.eg:
ADB forward tcp:6100 local:logd//PC All 6100-port communication data will be redirected to the phone-side/simulator UNIX type socket

-

ADB forward--no-rebind <local> <remote>
-Same as ' adb forward <local> <remote> ' but fails

<!--
If you specify--no-rebind, the same adb forward <local> <remote> command will fail.
-

If <local> is already forwarded

<!--if <local> has been forwarded--

ADB forward--remove <local>-remove a specific forward socket connection

<!--adb forward--remove <local> removes a specified forward socket connection--

ADB forward--remove-all-remove all forward socket connections

<!--adb forward--remove-all Remove all forward socket connections--

ADB jdwp-list PIDs of processes hosting a JDWP transport

<!--adb jdwp shows a list of processes that are hosted on a jdwp transfer--

ADB install [-l] [-r] [-d] [-S] [--algo <algorithm name>--key y>--iv

-Push this package file to the device and install it
('-l ' means forward-lock the app)
('-R ' means reinstall the app, keeping its data
)
('-d ' means allow version code downgrade)
('-s ' means install on SD card instead of internal storage)
('--algo ', '--key ', and '--iv ' mean the file is encrypted already)

<!--
ADB install [-l] [-r] [-d] [-S] [--algo <algorithm name>--key y>--iv -L indicates a locked app,
-R means reinstalling the app, preserving the original data,
-d means allow version code demotion
-S means that the SD card is installed instead of the internal storage
'--algo ', '--key ', and '--iv ' means the file is encrypted
-


adb uninstall [-K] <package>-remove this app from the device
('-K ' means keep the data and cache directories
)

<!--
adb uninstall [-K] <package> command to remove the APK package installed on the device,
-K means preserving data and caching directories
-

ADB Bugreport-return all information from the device that should is included in a bug report.

<!--
ADB bugreport All information about the output device, included in the bug report.
-

ADB backup [-f <file>] [-apk|-noapk] [-obb|-noobb] [-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" under the current directory.
(-apk|-noapk enable/disable Backup of the. APKs themselves in the archive;
The default is noapk.)
(-obb|-noobb enable/disable Backup of any installed APK expansion
(aka. Obb) files associated with each application; The default is Noobb.)
(-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 are passed and then the package list is optional.
Applications explicitly given on the command line'll be included
Even If-nosystem would ordinarily cause them to be omitted.)

<!--adb backup [-f <file>] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all]
[-system|-nosystem] [<packages...>] writes the device's data to an archive file <file> (PC catalog file).
If the-f option is not provided, the data is written to the Backup.ab file in the current directory.
-APK|-NOAPK Enable/disable backup of your own APK file into the archive. Disabled by default.
-obb|-noobb Enable/disable backup of any installed APK extension files associated with each application (aka. obb file (opaque binary blobs))
-shared|-noshared Enable/disable device shared storage/SD card content backup. Disabled by default.
-all back up all installed apps. -all automatically includes system apps by default.
-SYSTEM|-NOSYSTEM Specifies whether to toggle the Include System app. The default is to include system apps.
<packages...> List of applications that need to be backed up
If you have already used the-all or-shared tag, then the package list <packages...> is optional.
The application is explicitly included in the command line, even if the-nosystem tag specifies that the system app is ignored.
-

ADB restore <file>-restore device contents from the <file> backup archive
<!--adb restore <file> restore device content with backed-up archive--
ADB help-show this Help message
<!--adb Help displays ADB support information-
ADB version-show version num
<!--adb version displays ADB edition number--

Scripting
<!--Scripts--
ADB wait-for-device-block until device is online
<!--adb wait-for-device wait until the device is online--

ADB start-server-ensure that there is a server running
<!--ADB start-server ensure service is running--

ADB Kill-server-kill the server if it is running
<!--ADB Kill-server kills running services--

ADB Get-state-prints:offline | bootloader | Device
<!--adb get-state printing device status: Offline | bootloader | Device-->

ADB get-serialno-prints: <serial-number>
<!--adb Get-serialno printing device serial number information--

ADB get-devpath-prints: <device-path>
<!--adb Get-devpath print device path--

ADB status-window-continuously print device status for a specified device
<!--adb Status-window continuous printing of specified device status--

ADB remount-remounts The/system partition on the device read-write
<!--adb remount to re-mount its device system partition read-write

ADB reboot [Bootloader|recovery]-reboots the device, optionally into the bootloader or recovery program
<!--adb reboot Restart the device, optional access to the boot program or recovery program. -

ADB reboot-bootloader-reboots the device into the bootloader
<!--adb Reboot-bootloader Restart the device and enter the boot program (brush mode). -

ADB root-restarts the adbd daemon with root permissions
<!--adb Root restarts the ADBD background process for root privileges

ADB usb-restarts the ADBD daemon listening on USB
<!--ADB USB Restart ADBD background process monitoring usb-->

ADB TCPIP <port>-Restarts the adbd daemon listening on TCP on the specified port
<!--adb tcpip <port> Restart ADBD background process to listen on the specified TCP port--

Networking
<!--Network--
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. Default route 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.


<!--
ADB PPP <tty> [parameters]-PPP running on USB.

Note: You cannot automatically start a PPP connection.

<tty> refers to the TTY as a PPP stream. For example. Dev:/dev/omap_csmi_tty1[parameters]
For example Default route debug discards local Notty Usepeerdns

adb sync notes:adb Sync [< catalogue >]

<localdir> can be explained in several ways:

-If not specified <directory>< directory >/system and/data partitions will be updated.

-If it is "system" or "data", only the corresponding partition is updated.

-

Environmental variables:
<!--environment 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
<!--
Adb_trace environment variable-print debugging information. Use a comma-delimited list of one or all of the following: 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_serial-the serial number to which it is connected. Given the-s parameter, it will have precedence over this environment variable. -

Android_log_tags-when used with the LOGCAT option, only these debug TAGS is printed.
<!--android_log_tags Environment variables-when you use the LOGCAT option, only these debug labels will be printed. -

Documents related to the official ADB tool can be found in:
Http://developer.android.com/tools/help/adb.html

Sufish
Source:http://www.cnblogs.com/dotnetframework/

This article is copyrighted by the author and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link. If you have questions, you can email: [Email protected] contact me, thank you very much.

Android Note adb command parsing 1

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.