LearnHouse

[Android]常用ADB Shell

列出package name

pm list packages

列出apk位置

pm list packages -f

啟動app

am start -n <package name>/<main activity>

ex. am start -n com.package.name/.NameActivity

關閉app

am force-stop <package name>

從apk查package name & activity

aapt dump xmltree Sample.apk AndroidManifest.xml

重啟adb server
adb kill-server
adb start-server

安裝.apk

adb install XXX.apk

刪除app

pm uninstall <package name>

刪除系統app

pm uninstall -k --user 0 <package name>

發送廣播broadcast

adb shell am broadcast -a com.android.test --es key_string "this is test string" --ei key_int 100 --ez key_boolean true

key "value" => key_string "this is test string"

--es 字串,  --ei 整數,  --ez 布林

http://www.tttabc.com/android/Android-Shell.html

posted by admin in 程式&軟體 and have No Comments

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment