微信跳一跳高分系列一:解读 adb 工具
生活随笔
收集整理的這篇文章主要介紹了
微信跳一跳高分系列一:解读 adb 工具
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
adb
常用命令
general commands: // 常用命令devices [-l] list connected devices (-l for long output) // 列出當前鏈接到 adb-server 的設備help show this help message // 查看幫助version show version num // 顯示當前版本號文件傳輸
file transfer: // 文件傳輸push LOCAL... REMOTE // 推送PC文件到手機: push d://demo.txt /sdcard/copy local files/directories to devicepull [-a] REMOTE... LOCAL // 拉取手機文件到PC: pull /sdcard/demo.txt d://mobilecopy files/dirs from device-a: preserve file timestamp and modesync [DIR] // 同步目錄到手機copy all changed files to device; if DIR is "system", "vendor", "oem",or "data", only sync that partition (default all)-l: list but don't copyshell 命令
shell: // shell 命令(常用于模擬點擊、輸入、截屏、錄屏等事件)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 emu COMMAND run emulator console command安裝 apk
app installation: // 安裝 apkinstall [-lrtsdg] PACKAGEinstall-multiple [-lrtsdpg] PACKAGE...push package(s) to the device and install them // 先將安裝包推送到手機端,然后安裝: install com.youhua-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)-p: partial application install (install-multiple only)-g: grant all runtime permissionsuninstall [-k] PACKAGEremove this app package from the device'-k': keep the data and cache directories備份和還原
backup/restore: // 備份和還原backup [-f FILE] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all] [-system|-nosystem] [PACKAGE...]write an archive of the device's data to FILE [default=backup.adb]package list optional if -all/-shared are supplied-apk/-noapk: do/don't back up .apk files (default -noapk)-obb/-noobb: do/don't back up .obb files (default -noobb)-shared|-noshared: do/don't back up shared storage (default -noshared)-all: back up all installed applications-system|-nosystem: include system apps in -all (default -system)restore FILE restore device contents from FILE調試
debugging: // 調試bugreport [PATH]write bugreport to given PATH [default=bugreport.zip];if PATH is a directory, the bug report is saved in that directory.devices that don't support zipped bug reports output to stdout.jdwp list pids of processes hosting a JDWP transportlogcat show device log (logcat --help for more)安全
security:// 安全disable-verity disable dm-verity checking on userdebug buildsenable-verity re-enable dm-verity checking on userdebug buildskeygen FILEgenerate adb public/private key; private key stored in FILE,public key stored in FILE.pub (existing files overwritten)腳本
scripting:wait-for[-TRANSPORT]-STATEwait for device to be in the given stateState: device, recovery, sideload, or bootloaderTransport: usb, local, or any [default=any]get-state print offline | bootloader | deviceget-serialno print <serial-number>get-devpath print <device-path>remountremount /system, /vendor, and /oem partitions read-writereboot [bootloader|recovery|sideload|sideload-auto-reboot]reboot the device; defaults to booting system image butsupports bootloader and recovery too. sideload rebootsinto recovery and automatically starts sideload mode,sideload-auto-reboot is the same but reboots after sideloading.sideload OTAPACKAGE sideload the given full OTA packageroot restart adbd with root permissionsunroot restart adbd without root permissionsusb restart adb server listening on USB // 重新啟動 正在監聽 usb 的 adb-servertcpip PORT restart adb server listening on TCP on PORT internal debugging:start-server ensure that there is a server runningkill-server kill the server if it is runningreconnect kick connection from host side to force reconnectreconnect device kick connection from device side to force reconnect環境變量
environment variables: // 環境變量$ADB_TRACEcomma-separated list of debug info to log:all,adb,sockets,packets,rwx,usb,sync,sysdeps,transport,jdwp$ADB_VENDOR_KEYS colon-separated list of keys (files or directories)$ANDROID_SERIAL serial number to connect to (see -s)$ANDROID_LOG_TAGS tags to be used by logcat (see logcat --help)總結
以上是生活随笔為你收集整理的微信跳一跳高分系列一:解读 adb 工具的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微信跳一跳高分系列二:adb shell
- 下一篇: 微信跳一跳高分系列四:一个 JAVA 版