android:那些常用的adb命令

來源:互聯網
上載者:User

標籤:android   style   http   ar   color   os   sp   檔案   資料   



1.列舉當前的設配:
adb devices
例如:
localhost:~ newuser$ adb devices
List of devices attached 
BH903QDW15device
41008990d29eb000device


2.針對某一個裝置進行
adb -s <serialNumber> <command> 
例如:
adb -s BH903QDW15 install hello.apk


3.安裝app
adb install <path_to_apk>


4.檔案複製
4.1從手機拉到本地
adb pull <remote> <local>
例如:
adb pull /sdcard/foo.txt  foo.txt
4.2從本地推到手機
adb push <local> <remote>
例如:
adb push foo.txt /sdcard/foo.txt


5.卸載軟體
adb shell pm uninstall <packageName>
例如:
adb -s BH903QDW15 shell pm uninstall -k com.example.hello
-k 卸載之後保留資料
註:adb shell pm [command]
有很多命令:詳見:http://developer.android.com/tools/help/adb.html


6.螢幕錄製:
adb shell screenrecord /sdcard/demo.mp4
錄製完之後,可以通過pull,將檔案複製到本地,參見4.1


7.查看所有的adb shell指令
adb shell ls /system/bin


8.在螢幕上隨機點擊測試:
adb shell monkey -v -p <packageName> <number>


9.列舉所安裝軟體的包名:
adb shell pm list packages
例如,列舉第三方軟體的包名:
adb shell pm list packages -3


更多命令:http://developer.android.com/tools/help/adb.html

-------------------------------------------------------------------

更多交流,Android開發聯盟QQ群:272209595


android:那些常用的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.