使用ADB自动切换应用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013483704/article/details/80665410

配合windows BAT简单测试脚本

  1. 获取当前焦点的应用包名
    adb shell dumpsys activity | findstr mFocused

  2. 获取运行过的activity
    adb shell dumpsys activity | findstr ActivityRecord

  3. 自动切换应用
    adb kill-server
    adb start-server
    adb root
    adb remount

    :start
    adb shell am start -n com.xxx.xxxxxxx/.MainActivity
    ping -n 1 127.0.0.1 > nul
    goto start

猜你喜欢

转载自blog.csdn.net/u013483704/article/details/80665410