• 解决appium 提示:UiAutomationService android.accessibilityservice....registered!


    报错信息
    [Instrumentation] Caused by: java.lang.IllegalStateException: UiAutomationService android.accessibilityservice.IAccessibilityServiceClient S t u b Stub StubProxy@af533b6already registered!
    [Instrumentation] at android.os.Parcel.createException(Parcel.java:2079)
    [Instrumentation] at android.os.Parcel.readException(Parcel.java:2039)
    [Instrumentation] at android.os.Parcel.readException(Parcel.java:1987)
    [Instrumentation] at android.app.IUiAutomationConnection S t u b Stub StubProxy.connect(IUiAutomationConnection.java:427)
    [Instrumentation] at android.app.UiAutomation.connect(UiAutomation.java:241)
    [Instrumentation] at android.app.Instrumentation.getUiAutomation(Instrumentation.java:2160)
    [Instrumentation] at androidx.test.uiautomator.UiDevice.getUiAutomation(UiDevice.java:1129)
    [Instrumentation] at androidx.test.uiautomator.QueryController.(QueryController.java:95)
    [Instrumentation] at androidx.test.uiautomator.UiDevice.(UiDevice.java:109)
    [Instrumentation] at androidx.test.uiautomator.UiDevice.getInstance(UiDevice.java:261)
    [Instrumentation] at io.appium.uiautomator2.utils.Device.getUiDevice(Device.java:40)
    [Instrumentation] at io.appium.uiautomator2.model.internal.CustomUiDevice.(CustomUiDevice.java:75)
    [Instrumentation] at io.appium.uiautomator2.model.internal.CustomUiDevice.getInstance(CustomUiDevice.java:90)
    [Instrumentation] at io.appium.uiautomator2.server.mjpeg.MjpegScreenshotStream.(MjpegScreenshotStream.java:43)

    通过Caused by 的错误信息搜索得知因为uiautomator的进程已经存在,需要先杀死进程

    解决方法:
    .查询adb进程:

    adb shell ps | find "uiautomator"
    
    • 1

    杀死进程:

    adb shell kill
    如果提示" /system/bin/sh: kill: 1835: Operation not permitted ",需要切换adb为root 权限,再杀死进程
    adb root
    再重新启动程序

  • 相关阅读:
    ubuntu安全扩展交换内存swap memory
    玩转Mysql系列 - 第14篇:详解事务
    SpringBoot-19-模块开发-员工修改/删除
    力扣第77题 组合 c++ 回溯经典题 注释加优化 代码
    C++程序文件的目录结构
    【HDU No. 4417】 超级马里奥 Super Mario
    [Linux]进程信号
    C++入门(2)—函数重载、引用
    右击显示Pycharm打开教程
    【校招VIP】测试技术考点之单元测试&集成测试
  • 原文地址:https://blog.csdn.net/shelutai/article/details/125468568