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

  • 相关阅读:
    掌握这些插件,分分钟提高你的办公效率90%!
    IDLE开发wordCount程序(第五弹)
    关于butterfly主题
    UML类图中各箭头表示总结
    MIT6.5830 Lab1-GoDB实验记录(一)
    Linux基本指令——综合操作
    技术面试与HR面:两者之间的关联与区别
    sku详情接口
    Word控件Spire.Doc 【文本】教程(21) ;如何在 C# 中用 Word 文档替换文本
    组合拳SSRF+redis未授权访问
  • 原文地址:https://blog.csdn.net/shelutai/article/details/125468568