android開發筆記之ADB Shell Commands
對於android開發來說,adb shell 命令是我們經常使用的開發命令,下面對這些常用的關鍵adb shell 命令進行一些說明。
adb shell 命令的官方網站
https://developer.android.com/studio/command-line/shell.html#othershellcommands
adb shell 命令的官方網站,如果對於adb shell命令有任何問題,可以去android官網去檢視權威的說明。
Using activity manager (am)
啟動activity
adb shell am start -a android.intent.action.VIEW
adb shell am start com.example.appinfomanagertinno/.MainActivity
啟動service
adb shell am startservice -a com.lt.test.action.ONESERVICE
adb shell am startservice com.android.music/.MediaPlaybackService
啟動廣播
adb shell am broadcast -a android.intent.action.MASTER_CLEAR(恢復出廠設定的方法,會清除記憶體所有內容)
adb shell am broadcast -n com.lt.test/.MyBroadcast
關閉一個應用:
adb shell am force-stop com.example.appinfomanagertinno
關閉所有的後臺程式
adb shell am kill-all
Using package manager (pm)
檢視所有packages:
adb shell pm list packages
檢視特定的packages:
adb shell pm list packages | grep tinno
package:com.applock.tinno
package:com.tinno.simmelock
package:com.tinno.gesture.phone
package:com.tinno.engineermode
package:com.tinno.lanixcodes
package:com.tinno.smartpowersaver
package:com.tinno.gps
package:com.tinno
檢視package的apk位置:
adb shell pm path com.applock.tinno
package:/system/app/applock_tinno/applock_tinno.apk
刪除一個apk:
adb shell pm uninstall com.example.MyApp
檢視所有的features:
adb shell pm list features
檢視最多支援幾個使用者:
adb shell pm get-max-users
Maximum supported users: 4
檢視手機上所有的user資訊:
adb shell pm list users
檢視手機所有的permissions:
adb shell pm list permissions
清除package所有的相關資料:
adb shell pm clear <PACKAGE>
比如清除launcher所有的資料:
adb shell pm clear com.ape.launcher3
Success
手機截圖:
adb shell screencap /sdcard/screen.png
或者:
$ adb shell
shell@ $ screencap /sdcard/screen.png
shell@ $ exit
$ adb pull /sdcard/screen.png
手機錄影:
$ adb shell screenrecord /sdcard/demo.mp4
相關文章
- [轉]Handy adb commands for AndroidAndroid
- Android學習筆記·ADBAndroid筆記
- Android adb shell命令大全Android
- Android adb shell 命令大全Android
- Android開發筆記Android筆記
- Android個人開發筆記Android筆記
- android adb shell 常用命令Android
- xecuting shell commands with bash
- 《Android藝術開發探索》學習筆記之IPCAndroid筆記
- android開發筆記之內建圖片到相簿Android筆記
- ADB 實用筆記筆記
- 常用adb 和 adb shell 命令
- 34個Android常用adb shell命令彙總Android
- Android應用開發筆記(一)Android筆記
- Android之adb的使用Android
- shell 筆記筆記
- Android 開發中常用 ADB 命令總結Android
- MongoDB 學習筆記之常用 shell 命令MongoDB筆記
- adb shell 命令整理
- adb shell 埠占用
- Android開發筆記[10]-關於頁Android筆記
- Android開發筆記[17]-桌面小部件Android筆記
- Android開發筆記[18]-使用本地模組Android筆記
- 《Android藝術開發探索》學習筆記之View的工作原理Android筆記View
- 開發:隨筆記錄之 HTTP 呼叫筆記HTTP
- android開發學習筆記系列(1)-android起航Android筆記
- 【Shell】sort 筆記筆記
- Android開發筆記——TextView 多行時 ellipsizeAndroid筆記TextView
- Android開發筆記[13]-圖案密碼Android筆記密碼
- adb shell am broadcastAST
- adb shell input keyevent
- 《Android藝術開發探索》學習筆記之Activity的生命週期Android筆記
- mysql 使用 informatin_schema tables 建立 shell commandsMySqlORM
- 《Android藝術開發探索》學習筆記之View的事件體系(一)Android筆記View事件
- shell學習筆記筆記
- 以前的shell筆記筆記
- Android開發筆記(一百一十九)工具欄ToolBarAndroid筆記
- android遊戲開發自學筆記3-2Android遊戲開發筆記