承接上文啦!!!
adb devices
打印所有鏈接的模擬器或者設備
adb forward <local> <remote>
建立本機端口8000 轉發(fā)到模擬器或者設備的9000端口
adb kill-servser<===>adb start-server
關閉adb服務<====>開啟adb服務
adb connect
通過WiFi鏈接
1.首先先通過USB鏈接
2.然后使用adb devices 查看設備
3.adb tcpip 5555 重啟TCP端口:5555
4.通過手機查看手機的ip地址并記錄
5.adb connect ip:5555
6.拔掉USB線,你仍然可以訪問到設備此時adb devices 查看的時候會顯示ip
adb usb
以USB模式重啟adb
adb install [option]<path>
adb install test.apk
adb install -l test.apk 鎖定應用
adb install -r test.apk 替換現有的應用
adb install -t test.apk 允許測試包
adb install -s test.apk 安裝在sd卡上
adb install -d test.apk 版本降級
adb install -p test.apk 部分應用安裝
adb uninstall [options]<package>
adb uninstall com.test.app
adb uninstall -k com.test.app 刪除應用后保留數據
adb shell pm list package [options]<filtes>
adb shell pm list packages
adb shell pm list packages -f 查看相關文件
adb shell pm list packages -d 顯示被禁用的包
adb shell pm list packages -e 顯示已啟用的包
adb shell pm list packages -s 顯示系統(tǒng)包
adb shell pm list packages -3 顯示第三方包
adb shell pm list packages -i 顯示已安裝的包
adb shell pm list packages -u 也顯示卸載的包
adb shell pm list packages —user <USER_ID> 用戶空間
adb shell pm path <package>
adb shell pm path com.android.phone
adb shell pm clear <package>
adb shell pm clear com.test.abc 清楚應用數據、緩存
adb pull <remote>[local]
adb pull /sdcard/demo.mp4 下載/sdcard/demo.mp4到/platform-tools目錄中
adb pull /sdcard/demo.mp4 e:\ 下載/sdcard/demo.mp4到e盤
adb push <local>[remote]
adb push test.apk /sdcard 將platform-tools/test.apk 復制到/sdcard
adb push d:\test.apk /sdcard
adb shell ls
1.adb shell
2.ls
ls -a
ls -i
ls -s
ls -n
ls -R
adb shell cd
adb shell rm
adb shell rm -f
adb shell rm -r
adb shell rm -d
adb shell rm -i
adb shell mkdir
mkdir -m 777 /sdcard/tmp 設置權限
mkdir -p /sdcard/tmp 根據需要創(chuàng)建
adb shell touch
touch /sdcard/tmp/test.txt 可以顯示 ls /sdcard/tmp
adb shell pwd 顯示當前位置
adb shell cp
cp /sdcard/test.txt /sdcard/demo.txt 復制
adb shell mv
mv /sdcard/tmp /system/tmp 移動
mv /sdcard/tmp /sdcard/test 重命名
adb shell netstat 網絡統(tǒng)計
adb shell ping www.baidu.com
adb shell netcfg 網絡配置和管理
adb shell ip
ip -f inet addr show waln0 顯示WiFi-IP地址
adb logcat
adb logcat *:V 最低優(yōu)先級只顯示詳細信息
adb logcat *:D 只顯示調試信息
adb logcat *:I 只顯示信息
adb logcat *:W 只顯示警告信息
adb logcat *:E 只顯示錯誤信息
adb logcat *:F 只顯示致命信息
adb logcat *:S 最高級別
adb logcat -b radio 查看無線電或者電話相關的消息緩沖區(qū)
adb logcat -b event 查看事件相關緩沖區(qū)
adb logcat -b main 默認
adb logcat -c 清除整個緩沖區(qū)并退出
adb logcat -d 打印日志并退出
adb logcat -f test.logs 將日志信息寫入test
adb logcat -g 打印日志緩沖區(qū)并退出
adb logcat -n <count> 設置日志數量
adb logcat -r <kbytes> 按字節(jié)數輸出日志
adb logcat -s 設置默認
adb logcat -v brief 顯示優(yōu)先級和PID
adb logcat -v process 顯示PID
adb logcat -v tag 顯示優(yōu)先級
adb logcat -v raw 只顯示原始日志信息
adb logcat -v time 顯示日期、時間、優(yōu)先級、PID
adb logcat -v threadtime 顯示日期、時間、優(yōu)先級、PID、TID
adb logcat -v long 顯示所有字段并用空格分隔
adb shell dumpsys
dumps system data
adb shell dumpsys battery 注:安卓5.0
adb shell dumpsys batterystats 收集電池數據
adb shell dumpsys batterystats —reset 擦出就數據
adb shell dumpsys activity
adb shell dumpsys gfxinfo com.android.phone measuring com.android.phone ui performance
adb shell dumpstate
adb shell dumpstate > state.logs 保存存儲狀態(tài)到文件
adb shell screencap <filename>
adb shell screencap /sdcard/screen.png
adb pull /sdcard/screen.png
adb shell screenrecord 安卓4.4
adb shell screenrecord /sdcard/demp.mp4
adb pull /sdcard/demo.mp4
adb shell screenrecord —size <width*height> 控制視頻尺寸
adb shell screenrecord —bit-rate <rete> 設置視頻比特率
adb shell screenrecord —time-limit <time> 單位:秒 設置視頻時間 默認為180秒
adb shell screenrecord —rotate 旋轉90度
adb shell screenrecord —verbose 在屏幕上顯示日志和命令行
adb root 以root用戶身份運行
adb sideload <update.zip>
adb shell ps
ps -p
adb shell top 顯示CPU的進程
top -t 顯示線程代替進程
adb shell getprop
adb shell set prop