常用adb 相關(guān)知識(shí)整理

1.安裝apk :

?????adb install <apk路徑>


2. 卸載apk:

????adb uninstall <包名>

????adb uninstall –k? <包名>? ? ? ?//其中 -k 參數(shù)為卸載軟件時(shí)保留配置和緩存文件


3. 截圖并保存到電腦:

? ??adb shell screencap -p /sdcard/01.png

????adb pull /sdcard/01.png


4. 清緩存:

????adb shell pm clear <包名>


5.模擬按鍵

??adb shell input keyevent <key>

例如最常用的一些:

//這條命令相當(dāng)于按了設(shè)備的Backkey鍵

adb shell input keyevent 4

?//可以解鎖屏幕

adb shell input keyevent ?82?

//在屏幕上做劃屏操作,前四個(gè)數(shù)為坐標(biāo)點(diǎn),后面是滑動(dòng)的時(shí)間(單位毫秒)

adb shell input swipe 50 250 250 250 500?

//在屏幕上點(diǎn)擊坐標(biāo)點(diǎn)x=50 ?y=250的位置。

adb shell input tap 50 250?

//輸入字符abc

adb shell input text abc

參考鏈接:https://www.cnblogs.com/chengchengla1990/p/4515108.html


6.推出ANR日志

adb pull /data/anr/traces.txt


7.打印日志并輸出到電腦

adb logcat >F:/log.log

參考文章

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容