常用adb命令

來源:互聯網
上載者:User

標籤:參數   緩衝   檔案夾複製   reader   UI   測試   sdk   uil   port   

移動端測試怎麼能不懂adb命令那,使用adb命令可以提升效率

 

* 查看裝置

adb devices

 

* 查看手機是否root

adb root

 

* 查看裝置上的包名

adb shell monkey --port 1080 -v -v

adb shell pm list package -f

 

* 查看package和activity

adb logcat | findstr START

cmd到sdk\build-tools\android-4.4W路徑下,然後aapt dump badging <local+apk>  

 

* 安裝apk

adb install  <apk路徑+apk名>

* 覆蓋安裝

adb install -r  <apk路徑+apk名>

* 電腦上串連多個裝置只在一個裝置上安裝apk

adb -s <裝置號> install  <apk路徑+apk名>

 

* 卸載apk

adb uninstall <包名>

* 參數保留卸載軟體配置和快取檔案

adb uninstall -k <包名>

 

* 查看bug報告,在檔案中搜尋fatal、crash

adb bugreport > f:\iReader_report.txt

 

* 查看log

adb logcat

* 清除緩衝日誌

adb logcat -c

* 查看協助文檔

adb logcat -h

 

* 把電腦上檔案或檔案夾複製到手機上

adb push <檔案的路徑><手機的路徑>
adb push <E:\muke.apk /data>

 

* 把手機上檔案或檔案夾複製到電腦上

adb pull <檔案的路徑><電腦的路徑>
adb pull </data/muke.apk E:\muke22.apk>

 

* 殺進程,找不到手機時使用,啟動adb服務,通常兩個命令一起用

adb kill-server

adb start-server

常用adb命令

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.