adb-获取包名/界面名、获取app启动时间、卸载app、退出app、查看所有进程
生活随笔
收集整理的這篇文章主要介紹了
adb-获取包名/界面名、获取app启动时间、卸载app、退出app、查看所有进程
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
獲取包名/界面名
Mac/Linux:
adb shell dumpsys window windows | grep mFocusedApp adb shell dumpsys window windows | grep mCurrentFocus adb shell dumpsys window | grep mCurrentFocusWindows:
adb shell dumpsys window windows | findstr mCurrentFocus adb shell dumpsys window | findstr mCurrentFocus adb shell dumpsys window windows | findstr mFocusedApp查看手機中所有的app包名
命令:adb shell pm list packages
只知道包名,用指令獲取啟動名
https://www.pianshen.com/article/56531511047/
adb shell
dumpsys package <應用包名>
找到Category為Launcher的Activity
獲取app啟動時間
adb shell am start -W 包名/啟動名 adb shell am start [options] <INTENT> # https://www.cnblogs.com/newliu/p/9164737.html adb shell am start -n com.android.settings/com.android.settings.homepage.SettingsHomepageActivity adb shell am start -a android.settings.SETTINGS卸載app
adb root 找package地址,adb shell pm path 包名 刪除包adb shell rm xxxx adb uninstall 包名 卸載手機上的app,需要指定包名退出app
adb shell am force-stop com.android.settings adb shell am force-stop 包名查看所有進程
adb shell ps adb shell "ps | grep com.mitac.gemini.cdr" # 不加引號會報錯 因為 windows不認識grep adb shell ps | findstr com.mitac.gemini.cdr # windows使用findstr 不報錯adb shell ps 相當于先執行adb shell再執行 ps -e
參數 -e 顯示運行在系統上的所有進程
參數 -f 擴展顯示輸出
只執行ps命令,默認是顯示當前控制臺下屬于當前用戶的進程
總結
以上是生活随笔為你收集整理的adb-获取包名/界面名、获取app启动时间、卸载app、退出app、查看所有进程的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JavaScript-函数
- 下一篇: Git简介、命令