adb鏈接狀態java
小技巧,能夠將本地路徑指定爲桌面,方便查看, 在桌面按住shift鍵,鼠標右鍵選擇在此處打開命令行窗口,直接輸入adb pull sdcard/Android/111.txt 執行,就可將111.txt複製到桌面。android
查看前臺 Activityshell
操做指令 adb shell am start -n 包名/類名瀏覽器
注:若是啓動activity時,出現以下錯誤
java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 > > cmp=com.mediatek.engineermode/.io.Gpio } from null (pid=3083, uid=2000) not exported from uid 1001app解決辦法,一、若是是你本身可控的app,那麼找到你要調用的activity在manifest.xml中,增長ui
配置便可, android:name="" 能夠爲空字符串。spa
二、若是是不可控的app,例如我調用的系統原生app,那麼你就洗洗睡吧,別折騰了,除非你修改源碼和上邊同樣操做,從新push替換原來的app。命令行
adb shell am start -a android.intent.action.VIEW -d http://testerhome.comdebug
adb shell am start -s com.android.camera/.Camera調試
adb shell am start -n com.android.camera/.Camera
adb shell am start -n com.android.settings/com.android.settings.Settings
adb shell am start -n com.android.settings/com.android.settings.wifi.WifiSettings
adb shell am start -n com.android.settings/com.android.settings.bluetooth.BluetoothSettings
操做指令 adb shell am broadcast -a 廣播名 --ei/es/ez 參數名 參數值 --ei/es/ez 參數名 參數值
例如以前寫的
Android6.0 源碼修改之Setting列表配置項動態添加和靜態添加, 當中就經過發送廣播來接收增長配置列表項
adb shell am broadcast -a cn.dynamic.add.settingcategoryitem --es location "0-2" --es title "紅" --es intent "com.android.settings.SCHEDULE_POWER_ON_OFF_SETTING"
adb shell input keycode 指令
HOME 鍵 adb shell input keycode 3
返回鍵 adb shell input keycode 4
打開瀏覽器 adb shell input keycode 64
adb shell wm 指令
adb shell ifconfig 命令
adb shell settings put global policy_control
可由以下幾種鍵及其對應的值組成,格式爲 key1=value1:key2=value2。
key 含義
value 含義
全部界面
adb shell settings put global policy_control immersive.full=*
adb shell settings put global policy_control immersive.preconfirms=*
adb shell settings put global policy_control immersive.status=com.package1,com.package2:immersive.navigation=apps,-com.package3