获取所有包名
pm list packages
如果知道部分名称,想查全称:
pm list packages | grep XXX
com.android.providers.media即为包名全称
查询APK名称
pm path com.android.providers.media
打开应用
adb shell am start +包名/.Activity (要启动的Activity)
adb shell am start com.android.settings/.HWSettings
关闭应用
cmd命令行中执行 adb shell am force-stop app包名
adb shell am force-stop com.android.settings关闭系统设置;
cmd命令行中执行 adb shell pm clear app包名
adb shell pm clear app com.android.settings 关闭系统设置
参考:
Android adb启动任意app的几种方式
https://www.jianshu.com/p/3d889de83211