在测试 android8 或者 9 的时候,将 automationName=UiAutomator2 定位就生效 ,但这样就没有办法捕获 toast 了...,看一下添加该配置后的 log:
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[UiAutomator2] Deleting UiAutomator2 session
[UiAutomator2] Deleting UiAutomator2 server session
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: Error: Trying to proxy a session command without session id
[ADB] Running '/Users/wangzhen/mywork/android-sdk-macosx/platform-tools/adb -P 5037 -s FA69K0303241 shell am force-stop cn.xiaochuankeji.tieba'
[Logcat] Stopping logcat capture
[ADB] Removing forwarded port socket connection: 8200
[ADB] Running '/Users/wangzhen/mywork/android-sdk-macosx/platform-tools/adb -P 5037 -s FA69K0303241 forward --remove tcp:8200'
[BaseDriver] Event 'newSessionStarted' logged at 1531138219847 (20:10:19 GMT+0800 (CST))