获取appPackage、appActivity
adb shell dumpsys activity|findstr mFocusedActivityraw_input
appPackage=com.ximalaya.ting.android
appActivity=.host.activity.MainActivity
获取当前的appPackage和appActivity
adb shell logcat|findstr "Displayed"
desired_caps['appPackage'] = 'com.ximalaya.ting.android'
desired_caps['appActivity'] = '.host.activity.WelComeActivity'
desired_caps['appWaitActivity']='.host.activity.MainActivity'
注意:
1、如果一行内容,在代码中去掉'appWaitActivity'项,或者'appActivity、appWaitActivity'都为'.host.activity.WelComeActivity'
2、如果有两行内容,则其中第一行是appPackage和appActivity,第二行是appWaitActivity