openatx / uiautomator2

Android Uiautomator2 Python Wrapper
MIT License
6.58k stars 1.41k forks source link

UI automator not installing on android 5 #688

Open ishandutta2007 opened 3 years ago

ishandutta2007 commented 3 years ago
[D 210612 16:49:40 __init__:608] kill process(ps): uiautomator
[D 210612 16:49:41 init:59] Use cached assets: C:\Users\hp\.uiautomator2\cache\app-uiautomator.apk-d3f17174fb\app-uiautomator.apk
[D 210612 16:49:45 __init__:348] pm install /data/local/tmp/app-uiautomator.apk
[D 210612 16:49:46 init:59] Use cached assets: C:\Users\hp\.uiautomator2\cache\app-uiautomator-test.apk-652bf9e13c\app-uiautomator-test.apk
[D 210612 16:49:48 __init__:348] pm install /data/local/tmp/app-uiautomator-test.apk
[D 210612 16:49:49 __init__:625] uiautomator-v2 is starting ... left: 40.0s
[D 210612 16:49:50 __init__:625] uiautomator-v2 is starting ... left: 38.8s
[I 210612 16:49:51 __init__:575] restart-uiautomator since "uiautomator2.GatewayError(gateway error, time used 0.0s)"
[D 210612 16:49:51 __init__:608] kill process(ps): uiautomator
[D 210612 16:49:52 init:59] Use cached assets: C:\Users\hp\.uiautomator2\cache\app-uiautomator.apk-d3f17174fb\app-uiautomator.apk
[D 210612 16:49:57 __init__:348] pm install /data/local/tmp/app-uiautomator.apk
[D 210612 16:49:58 init:59] Use cached assets: C:\Users\hp\.uiautomator2\cache\app-uiautomator-test.apk-652bf9e13c\app-uiautomator-test.apk
[D 210612 16:50:00 __init__:348] pm install /data/local/tmp/app-uiautomator-test.apk
[D 210612 16:50:00 __init__:666] grant permissions
[D 210612 16:50:03 __init__:625] uiautomator-v2 is starting ... left: 40.0s
[D 210612 16:50:04 __init__:625] uiautomator-v2 is starting ... left: 38.6s
Traceback (most recent call last):
  File "C:\Users\hp\.pyenv\pyenv-win\versions\3.8.0\lib\site-packages\uiautomator2\__init__.py", line 442, in _jsonrpc_retry_call
    return self._jsonrpc_call(*args, **kwargs)
  File "C:\Users\hp\.pyenv\pyenv-win\versions\3.8.0\lib\site-packages\uiautomator2\__init__.py", line 477, in _jsonrpc_call
    raise GatewayError(
uiautomator2.exceptions.GatewayError: uiautomator2.GatewayError(gateway error, time used 0.0s)

During handling of the above exception, another exception occurred:

I have another android 5 device, there it works fine, but not on this, here is the detailed specs of the failing device.

redmi_4i

ishandutta2007 commented 3 years ago

adb shell am instrument -w -r -e debug false -e class com.github.uiautomator.stub.Stub com.github.uiautomator.test/androidx.test.runner.AndroidJUnitRunner



INSTRUMENTATION_STATUS: id=ActivityManagerService
INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: ComponentInfo{com.github.uiautomator.test/androidx.test.runner.AndroidJUnitRunner}
INSTRUMENTATION_STATUS_CODE: -1
android.util.AndroidException: INSTRUMENTATION_FAILED: com.github.uiautomator.test/androidx.test.runner.AndroidJUnitRunner
        at com.android.commands.am.Am.runInstrument(Am.java:982)
        at com.android.commands.am.Am.onRun(Am.java:317)
        at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
        at com.android.commands.am.Am.main(Am.java:97)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:32
```9)
mingyuan-xia commented 3 years ago

can you also report the version of com.github.uiautomator.test

killaragorn commented 3 years ago

我也出现了这个错误, image

codeskyblue commented 3 years ago

看起来时这个包 /data/local/tmp/app-uiautomator-test.apk 没装到手机上