获取手机上当前正在运行的APP的包名+Activity名&使用ADB命令启动手机(Android)APP

  • 手机连接电脑,开启USB调试,

  • windows下载ADB,设置环境变量,然后打开cmd

  • 获取手机上当前正在运行的APP的包名+Activity名
    adb命令

    adb shell dumpsys window | findstr mCurrentFocus
    
  • 执行结果

     mCurrentFocus=Window{
          
          d9a816a u0 com.xxx.xxx/com.xxx.xxx.ui.activity.TabActivity}
    

    其中com.xxx.xxx就是包名,

  • ADB启动APP命令:

    adb shell am start com.xxx.xxx/com.xxx.xxx.ui.activity.TabActivity
    

猜你喜欢

转载自blog.csdn.net/qq_39735878/article/details/125184616
今日推荐