承接上文啦!=ρ扩淀!
adb devices
打印所有鏈接的模擬器或者設(shè)備
adb forward <local> <remote>
建立本機(jī)端口8000 轉(zhuǎn)發(fā)到模擬器或者設(shè)備的9000端口
adb kill-servser<===>adb start-server
關(guān)閉adb服務(wù)<====>開啟adb服務(wù)
adb connect
通過WiFi鏈接
1.首先先通過USB鏈接
2.然后使用adb devices 查看設(shè)備
3.adb tcpip 5555 重啟TCP端口:5555
4.通過手機(jī)查看手機(jī)的ip地址并記錄
5.adb connect ip:5555
6.拔掉USB線,你仍然可以訪問到設(shè)備此時(shí)adb devices 查看的時(shí)候會(huì)顯示ip
adb usb
以USB模式重啟adb
adb install [option]<path>
adb install test.apk
adb install -l test.apk 鎖定應(yīng)用
adb install -r test.apk 替換現(xiàn)有的應(yīng)用
adb install -t test.apk 允許測試包
adb install -s test.apk 安裝在sd卡上
adb install -d test.apk 版本降級(jí)
adb install -p test.apk 部分應(yīng)用安裝
adb uninstall [options]<package>
adb uninstall com.test.app
adb uninstall -k com.test.app 刪除應(yīng)用后保留數(shù)據(jù)
adb shell pm list package [options]<filtes>
adb shell pm list packages
adb shell pm list packages -f 查看相關(guān)文件
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 清楚應(yīng)用數(shù)據(jù)蔫敲、緩存
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 復(fù)制到/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 設(shè)置權(quán)限
mkdir -p /sdcard/tmp 根據(jù)需要?jiǎng)?chuàng)建
adb shell touch
touch /sdcard/tmp/test.txt 可以顯示 ls /sdcard/tmp
adb shell pwd 顯示當(dāng)前位置
adb shell cp
cp /sdcard/test.txt /sdcard/demo.txt 復(fù)制
adb shell mv
mv /sdcard/tmp /system/tmp 移動(dòng)
mv /sdcard/tmp /sdcard/test 重命名
adb shell netstat 網(wǎng)絡(luò)統(tǒng)計(jì)
adb shell ping www.baidu.com
adb shell netcfg 網(wǎng)絡(luò)配置和管理
adb shell ip
ip -f inet addr show waln0 顯示W(wǎng)iFi-IP地址
adb logcat
adb logcat *:V 最低優(yōu)先級(jí)只顯示詳細(xì)信息
adb logcat *:D 只顯示調(diào)試信息
adb logcat *:I 只顯示信息
adb logcat *:W 只顯示警告信息
adb logcat *:E 只顯示錯(cuò)誤信息
adb logcat *:F 只顯示致命信息
adb logcat *:S 最高級(jí)別
adb logcat -b radio 查看無線電或者電話相關(guān)的消息緩沖區(qū)
adb logcat -b event 查看事件相關(guān)緩沖區(qū)
adb logcat -b main 默認(rèn)
adb logcat -c 清除整個(gè)緩沖區(qū)并退出
adb logcat -d 打印日志并退出
adb logcat -f test.logs 將日志信息寫入test
adb logcat -g 打印日志緩沖區(qū)并退出
adb logcat -n <count> 設(shè)置日志數(shù)量
adb logcat -r <kbytes> 按字節(jié)數(shù)輸出日志
adb logcat -s 設(shè)置默認(rèn)
adb logcat -v brief 顯示優(yōu)先級(jí)和PID
adb logcat -v process 顯示PID
adb logcat -v tag 顯示優(yōu)先級(jí)
adb logcat -v raw 只顯示原始日志信息
adb logcat -v time 顯示日期饲嗽、時(shí)間、優(yōu)先級(jí)奈嘿、PID
adb logcat -v threadtime 顯示日期貌虾、時(shí)間、優(yōu)先級(jí)裙犹、PID尽狠、TID
adb logcat -v long 顯示所有字段并用空格分隔
adb shell dumpsys
dumps system data
adb shell dumpsys battery 注:安卓5.0
adb shell dumpsys batterystats 收集電池?cái)?shù)據(jù)
adb shell dumpsys batterystats —reset 擦出就數(shù)據(jù)
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 保存存儲(chǔ)狀態(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> 設(shè)置視頻比特率
adb shell screenrecord —time-limit <time> 單位:秒 設(shè)置視頻時(shí)間 默認(rèn)為180秒
adb shell screenrecord —rotate 旋轉(zhuǎn)90度
adb shell screenrecord —verbose 在屏幕上顯示日志和命令行
adb root 以root用戶身份運(yùn)行
adb sideload <update.zip>
adb shell ps
ps -p
adb shell top 顯示CPU的進(jìn)程
top -t 顯示線程代替進(jìn)程
adb shell getprop
adb shell set prop