很可能的原因是包名和Activity名字不对。 用adb logcat找到正确的就好。
capabilities.setCapability("appPackage", "com.xxx"); capabilities.setCapability("appActivity", ".WelcomeActivity"); capabilities.setCapability("appWaitPackage", "com.xxx"); capabilities.setCapability("appWaitActivity", ".MainActivity"); capabilities.setCapability("appWaitDuration", "10000"); 带欢迎界面的,呵呵 WelcomeActivity是启动的,然后一直等MainActivity出来 -------------------- 另外,uiautomator2 current也能查看当前app的activity名字
|