ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

Android Debug Bridge (ADB) v1.0.31

2026/9/23 1:43:59 拓冰建站 浏览量
Android Debug Bridge (ADB) v1.0.31

Android Debug Bridge [ADB] v1.0.31

  • References

Android SDK Platform Tools for Windows, Linux, Mac (all versions)
https://developer.android.google.cn/studio/releases/platform-tools

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。C:\Users\user>adb ?
Android Debug Bridge version 1.0.31-a                            - directs adb to listen on all interfaces for a connection-d                            - directs command to the only connected USB devicereturns an error if more than one USB device is present.-e                            - directs command to the only running emulator.returns an error if more than one emulator is running.-s <specific device>          - directs command to the device or emulator with the givenserial number or qualifier. Overrides ANDROID_SERIALenvironment variable.-p <product name or path>     - simple product name like 'sooner', ora relative/absolute path to a productout directory like 'out/target/product/sooner'.If -p is not specified, the ANDROID_PRODUCT_OUTenvironment variable is used, which mustbe an absolute path.-H                            - Name of adb server host (default: localhost)-P                            - Port of adb server (default: 5037)devices [-l]                  - list all connected devices('-l' will also list device qualifiers)connect <host>[:<port>]       - connect to a device via TCP/IPPort 5555 is used by default if no port number is specified.disconnect [<host>[:<port>]]  - disconnect from a TCP/IP device.Port 5555 is used by default if no port number is specified.Using this command with no additional argumentswill disconnect from all connected TCP/IP devices.
device commands:adb push <local> <remote>    - copy file/dir to deviceadb pull <remote> [<local>]  - copy file/dir from deviceadb sync [ <directory> ]     - copy host->device only if changed(-l means list but don't copy)(see 'adb help all')adb shell                    - run remote shell interactivelyadb shell <command>          - run remote shell commandadb emu <command>            - run emulator console commandadb logcat [ <filter-spec> ] - View device logadb forward --list           - list all forward socket connections.the format is a list of lines with the following format:<serial> " " <local> " " <remote> "\n"adb forward <local> <remote> - forward socket connectionsforward specs are one of:tcp:<port>localabstract:<unix domain socket name>localreserved:<unix domain socket name>localfilesystem:<unix domain socket name>dev:<character device name>jdwp:<process pid> (remote only)adb forward --no-rebind <local> <remote>- same as 'adb forward <local> <remote>' but failsif <local> is already forwardedadb forward --remove <local> - remove a specific forward socket connectionadb forward --remove-all     - remove all forward socket connectionsadb jdwp                     - list PIDs of processes hosting a JDWP transportadb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --iv <hex-encoded iv>] <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)('--algo', '--key', and '--iv' mean the file is encrypted already)adb uninstall [-k] <package> - remove this app package from the device('-k' means keep the data and cache directories)adb bugreport                - return all information from the devicethat should be included in a 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 then the data is writtento "backup.ab" in the current directory.(-apk|-noapk enable/disable backup of the .apks themselvesin the archive; the default is noapk.)(-obb|-noobb enable/disable backup of any installed apk expansion(aka .obb) files associated with each application; the defaultis noobb.)(-shared|-noshared enable/disable backup of the device'sshared storage / SD card contents; the default is noshared.)(-all means to back up all installed applications)(-system|-nosystem toggles whether -all automatically includessystem applications; the default is to include system apps)(<packages...> is the list of applications to be backed up.  Ifthe -all or -shared flags are passed, then the packagelist is optional.  Applications explicitly given on thecommand line will be included even if -nosystem wouldordinarily cause them to be omitted.)adb restore <file>           - restore device contents from the <file> backup archiveadb help                     - show this help messageadb version                  - show version numscripting:adb wait-for-device          - block until device is onlineadb start-server             - ensure that there is a server runningadb kill-server              - kill the server if it is runningadb get-state                - prints: offline | bootloader | deviceadb get-serialno             - prints: <serial-number>adb get-devpath              - prints: <device-path>adb status-window            - continuously print device status for a specified deviceadb remount                  - remounts the /system partition on the device read-writeadb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery programadb reboot-bootloader        - reboots the device into the bootloaderadb root                     - restarts the adbd daemon with root permissionsadb usb                      - restarts the adbd daemon listening on USBadb tcpip <port>             - restarts the adbd daemon listening on TCP on the specified port
networking: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 usepeerdnsadb sync notes: adb sync [ <directory> ]<localdir> can be interpreted in several ways:- If <directory> is not specified, both /system and /data partitions will be updated.- If it is "system" or "data", only the corresponding partitionis updated.environmental variables:ADB_TRACE                    - Print debug information. A comma separated list of the following values1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwpANDROID_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 are printed.C:\Users\user>

References

[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/