当前位置:   article > 正文

ADB 指令相关_listen on given socket for adb server [default=tcp

listen on given socket for adb server [default=tcp:localhost:5037]翻译

记录一下自己用过的adb指令

adb devices  查看连接的设备列表

adb server-strat  启动ADB服务

adb kill-server  停止ADB服务

adb install  path     安装     -r  path     覆盖安装 

adb uninstall  packname  删除应用

adb shell am start   启动应用

adb logcat  查看日志

adb connect [phone ip]:[port] 连接设备

adb disconnect  断开连接

adb shell   进入调试模式(以下指令都是基于调试模式)

wm  size    查看分辨率

wm  size   1280x720    修改屏幕分辨率

wm  density   查看屏幕密度

wm  density  160    修改屏幕密度

nercfg  查看ip地址信息

 

直接adb help查看帮助,不过是英文版的

  1. global options:
  2. -a listen on all network interfaces, not just localhost
  3. -d use USB device (error if multiple devices connected)
  4. -e use TCP/IP device (error if multiple TCP/IP devices available)
  5. -s SERIAL use device with given serial (overrides $ANDROID_SERIAL)
  6. -t ID use device with given transport id
  7. -H name of adb server host [default=localhost]
  8. -P port of adb server [default=5037]
  9. -L SOCKET listen on given socket for adb server [default=tcp:localhost:5037]
  10. general commands:
  11. devices [-l] list connected devices (-l for long output)
  12. help show this help message
  13. version show version num
  14. networking:
  15. connect HOST[:PORT] connect to a device via TCP/IP
  16. disconnect [[HOST]:PORT] disconnect from given TCP/IP device, or all
  17. forward --list list all forward socket connections
  18. forward [--no-rebind] LOCAL REMOTE
  19. forward socket connection using:
  20. tcp:<port> (<local> may be "tcp:0" to pick any open port)
  21. localabstract:<unix domain socket name>
  22. localreserved:<unix domain socket name>
  23. localfilesystem:<unix domain socket name>
  24. dev:<character device name>
  25. jdwp:<process pid> (remote only)
  26. forward --remove LOCAL remove specific forward socket connection
  27. forward --remove-all remove all forward socket connections
  28. ppp TTY [PARAMETER...] run PPP over USB
  29. reverse --list list all reverse socket connections from device
  30. reverse [--no-rebind] REMOTE LOCAL
  31. reverse socket connection using:
  32. tcp:<port> (<remote> may be "tcp:0" to pick any open port)
  33. localabstract:<unix domain socket name>
  34. localreserved:<unix domain socket name>
  35. localfilesystem:<unix domain socket name>
  36. reverse --remove REMOTE remove specific reverse socket connection
  37. reverse --remove-all remove all reverse socket connections from device
  38. file transfer:
  39. push [--sync] LOCAL... REMOTE
  40. copy local files/directories to device
  41. --sync: only push files that are newer on the host than the device
  42. pull [-a] REMOTE... LOCAL
  43. copy files/dirs from device
  44. -a: preserve file timestamp and mode
  45. sync [all|data|odm|oem|product|system|system_ext|vendor]
  46. sync a local build from $ANDROID_PRODUCT_OUT to the device (default all)
  47. -l: list files that would be copied, but don't copy them
  48. shell:
  49. shell [-e ESCAPE] [-n] [-Tt] [-x] [COMMAND...]
  50. run remote shell command (interactive shell if no command given)
  51. -e: choose escape character, or "none"; default '~'
  52. -n: don't read from stdin
  53. -T: disable PTY allocation
  54. -t: force PTY allocation
  55. -x: disable remote exit codes and stdout/stderr separation
  56. emu COMMAND run emulator console command
  57. app installation (see also `adb shell cmd package help`):
  58. install [-lrtsdg] [--instant] PACKAGE
  59. push a single package to the device and install it
  60. install-multiple [-lrtsdpg] [--instant] PACKAGE...
  61. push multiple APKs to the device for a single package and install them
  62. install-multi-package [-lrtsdpg] [--instant] PACKAGE...
  63. push one or more packages to the device and install them atomically
  64. -r: replace existing application
  65. -t: allow test packages
  66. -d: allow version code downgrade (debuggable packages only)
  67. -p: partial application install (install-multiple only)
  68. -g: grant all runtime permissions
  69. --abi ABI: override platform's default ABI
  70. --instant: cause the app to be installed as an ephemeral install app
  71. --no-streaming: always push APK to device and invoke Package Manager as separate steps
  72. --streaming: force streaming APK directly into Package Manager
  73. --fastdeploy: use fast deploy
  74. --no-fastdeploy: prevent use of fast deploy
  75. --force-agent: force update of deployment agent when using fast deploy
  76. --date-check-agent: update deployment agent when local version is newer and using fast deploy
  77. --version-check-agent: update deployment agent when local version has different version code and using fast deploy
  78. (See also `adb shell pm help` for more options.)
  79. uninstall [-k] PACKAGE
  80. remove this app package from the device
  81. '-k': keep the data and cache directories
  82. debugging:
  83. bugreport [PATH]
  84. write bugreport to given PATH [default=bugreport.zip];
  85. if PATH is a directory, the bug report is saved in that directory.
  86. devices that don't support zipped bug reports output to stdout.
  87. jdwp list pids of processes hosting a JDWP transport
  88. logcat show device log (logcat --help for more)
  89. security:
  90. disable-verity disable dm-verity checking on userdebug builds
  91. enable-verity re-enable dm-verity checking on userdebug builds
  92. keygen FILE
  93. generate adb public/private key; private key stored in FILE,
  94. scripting:
  95. wait-for[-TRANSPORT]-STATE
  96. wait for device to be in the given state
  97. STATE: device, recovery, rescue, sideload, bootloader, or disconnect
  98. TRANSPORT: usb, local, or any [default=any]
  99. get-state print offline | bootloader | device
  100. get-serialno print <serial-number>
  101. get-devpath print <device-path>
  102. remount [-R]
  103. remount partitions read-write. if a reboot is required, -R will
  104. will automatically reboot the device.
  105. reboot [bootloader|recovery|sideload|sideload-auto-reboot]
  106. reboot the device; defaults to booting system image but
  107. supports bootloader and recovery too. sideload reboots
  108. into recovery and automatically starts sideload mode,
  109. sideload-auto-reboot is the same but reboots after sideloading.
  110. sideload OTAPACKAGE sideload the given full OTA package
  111. root restart adbd with root permissions
  112. unroot restart adbd without root permissions
  113. usb restart adbd listening on USB
  114. tcpip PORT restart adbd listening on TCP on PORT
  115. internal debugging:
  116. start-server ensure that there is a server running
  117. kill-server kill the server if it is running
  118. reconnect kick connection from host side to force reconnect
  119. reconnect device kick connection from device side to force reconnect
  120. reconnect offline reset offline/unauthorized devices to force reconnect
  121. environment variables:
  122. $ADB_TRACE
  123. comma-separated list of debug info to log:
  124. all,adb,sockets,packets,rwx,usb,sync,sysdeps,transport,jdwp
  125. $ADB_VENDOR_KEYS colon-separated list of keys (files or directories)
  126. $ANDROID_SERIAL serial number to connect to (see -s)
  127. $ANDROID_LOG_TAGS tags to be used by logcat (see logcat --help)
  128. $ADB_LOCAL_TRANSPORT_MAX_PORT max emulator scan port (default 5585, 16 emus)

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/299204
推荐阅读
相关标签
  

闽ICP备14008679号