adb

来源:互联网 发布:可以看禁播的软件 编辑:程序博客网 时间:2024/06/15 01:05

Android Debug Bridge version 1.0.36
Revision 84e3321d5db3-android

-a - directs adb to listen on all interfaces for a connection
-d - directs command to the only connected USB device
returns 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 - directs command to the device or emulator with the given
serial number or qualifier. Overrides ANDROID_SERIAL
environment variable.
-p - simple product name like ‘sooner’, or
a relative/absolute path to a product
out directory like ‘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)
-P - Port of adb server (default: 5037)
devices [-l] - list all connected devices
(‘-l’ will also list device qualifiers)
connect [:] - connect to a device via TCP/IP
Port 5555 is used by default if no port number is specified.
disconnect [[:]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devices.

device commands:
adb push …
- copy files/dirs to device
adb pull [-a] …
- copy files/dirs from device
(-a preserves file timestamp and mode)
adb sync [ ] - copy host->device only if changed
(-l means list but don’t copy)
adb shell [-e escape] [-n] [-Tt] [-x] [command]
- run remote shell command (interactive shell if no command given)
(-e: choose escape character, or “none”; default ‘~’)
(-n: don’t read from stdin)
(-T: disable PTY allocation)
(-t: force PTY allocation)
(-x: disable remote exit codes and stdout/stderr separation)
adb emu - run emulator console command
adb logcat [ ] - View device log
adb forward –list - list all forward socket connections.
the format is a list of lines with the following format:
” ” ” ” “\n”
adb forward - forward socket connections
forward specs are one of:
tcp:
localabstract:
localreserved:
localfilesystem:
dev:
jdwp: (remote only)
adb forward –no-rebind
- same as ‘adb forward ’ but fails
if is already forwarded
adb forward –remove - remove a specific forward socket connection
adb forward –remove-all - remove all forward socket connections
adb reverse –list - list all reverse socket connections from device
adb reverse - reverse socket connections
reverse specs are one of:
tcp:
localabstract:
localreserved:
localfilesystem:
adb reverse –no-rebind
- same as ‘adb reverse ’ but fails
if is already reversed.
adb reverse –remove
- remove a specific reversed socket connection
adb reverse –remove-all - remove all reversed socket connections from device
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-lrtsdg]
- push this package file to the device and install it
(-l: forward lock application)
(-r: replace existing application)
(-t: allow test packages)
(-s: install application on sdcard)
(-d: allow version code downgrade (debuggable packages only))
(-g: grant all runtime permissions)
adb install-multiple [-lrtsdpg]

原创粉丝点击