Appium自动化报错: UiAutomationService already registered!

运行android自动化时遇到这个错误,Caused by: java.lang.IllegalStateException: UiAutomationService andr[email protected]38cefbbalready registered!

具体日志如下图:

Appium自动化报错: UiAutomationService already registered!

网上查了和我的情况都不大一样,看到这个帖子给了我一些思路,查了下uiautomator相关的进程有两个,可能存在冲突。

Appium自动化报错: UiAutomationService already registered!

com.github.uiautomator是weditor使用的另一个版本:https://github.com/openatx/uiautomator2。

通过adb uninstall把com.github.uiautomator和com.github.uiautomator.test再运行就没有报错了。

我们app是react native的应用,只有weditor能比较方便地定位元素。没办法了,只能再搞一台手机来定位。。。

大家有什么其他好的方法能定位react-native应用的元素吗?