adb簡介
? ? 1.adb(Android Debug Bridge)是Android sdk的一個(gè)工具
? ? 2.adb是連接電腦和手機(jī)的橋梁
? ? 3.adb具有安裝卸載apk、拷貝推送文件等功能
? ? 4.adb由客戶端、服務(wù)器、守護(hù)進(jìn)程組成
adb的常用指令
? ? 1.adb --help 幫助手冊
? ? 2.adb devices 檢測連接到電腦的安卓設(shè)備
? ? 3.adb logcat 打印log信息
? ? 4.adb logcat > D:/ log.txt 將日志信息放到D盤的log文本中
? ? 5.adb pull <手機(jī)路徑> <本機(jī)路徑> 拉取手機(jī)指定位置信息放到電腦指定位置
? ? 6.adb push <本地路徑> <手機(jī)路徑> 把電腦指定位置的信息放到手機(jī)指定位置
? ? 7.adb install xx.apk 安裝apk包
? ? 8.adb uninstall 應(yīng)用包名? 刪除指定的應(yīng)用
? ? 9.查看當(dāng)前應(yīng)用的包名和頁面名啟動(dòng)設(shè)備上的測試app,同時(shí)輸入下列命令查看當(dāng)前活動(dòng)的應(yīng)用包名?! ?/p>
Android 7.0:adb shell dumpsys activity activities | findstr mFocusedActivity
Android 8.0:adb shell dumpsys activity activities | findstr mResumedActivity
? ? 或者:adb shell dumpsys window | findstr mCurrentFocus
? ? 10.adb connect ip地址 通過wifi遠(yuǎn)程連接手機(jī)進(jìn)行調(diào)試
? ? 11.adb disconnect ip地址 斷開連接
? ? 12.adb tcpip 端口號(hào) 指定調(diào)試的端口號(hào)
monkey常用指令
? ? 1.adb shell monkey 1000 隨機(jī)運(yùn)行1000次
? ? 2.adb shell monkey -p 包名 1000 對指定包隨機(jī)運(yùn)行1000次
? ? 3.adb shell monkey -p 包名 -throttle100 1000 設(shè)置每次運(yùn)行的時(shí)間間隔
? ? 4.adb shell monkey -p 包名 -s 100 1000 seed指定隨機(jī)生成數(shù),多次運(yùn)行路徑都一致
? ? 5.adb shell monkey -p 包名 --pct-touch <百分比> -s 100 1000 設(shè)定觸摸事件的百分比
? ? 6.adb shell monkey -p 包名 --pct-motion <百分比> -s 100 1000 設(shè)定動(dòng)作事件的百分比
? ?
? ?