• 解决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
    再重新启动程序

  • 相关阅读:
    JAVA基础(二十七)——文件相关操作
    计算机毕业设计之java+javaweb的烘焙爱好者网站
    SWAGGER 出错解决
    SpringBoot进阶教程(七十七)WebSocket
    回文数 洛谷 - P1015
    会议OA小程序【会议管理,个人中心页面布局】
    windows7中安装docker
    前端工程化精讲第六课 团队工具:如何利用云开发提升团队开发效率?
    Java毕设项目——大学生社团管理系统(java+SSM+Maven+Mysql+Jsp)
    【C++】模板进阶
  • 原文地址:https://blog.csdn.net/shelutai/article/details/125468568