check the error messages:
OSError: [WinError adb shell am instrument -w -r -e debug false -e class com.github.uiautomator.stub.Stub com.github.uiautomator.test/android.support.test.runner.AndroidJUnitRunner] uiautomator2.GatewayError(gateway error, time used 0.0s): 'https://github.com/openatx/uiautomator2/wiki/Common-issues'
It is said that app-uiautomator.apk
or app-uiautomator-test.apk
not installed. but if you use the following command:
python -m uiautomator2 init
There are no errors, and you can see the successful installation of the above two apps, so the problem is not the failure of uiautomator app installation.
Solution:
Turn on the settings of Xiaomi mobile phone – turn on developer options – turn on USB debugging – turn on USB installation – turn on USB debugging (security settings) – turn on the application that passes USB verification (default on) – turn on wireless display authentication (optional). The key option is not to enable MIUI optimization. After operating the above settings, execute python -m uiautomator2 init (no error), and then you can execute the relevant scripts
Read More:
- [Solved] Python2 Flask startup error: [Errno 10053]
- [Solved] bert_as_service startup error: Tensorflow 2.1.0 is not tested!
- [Solved] celery Startup Error: kombu.exceptions.VersionMismatch: Redis transport requires redis-py versions 3.2.0 or later. You have 2.10.6
- [Solved] weditor Plug-in Dump Hierarchy Error: Local server not started, start with $ python -m weditor
- How to Solve Python picamera and raspistill error
- Using Python error urlopen error unknown URL type: the solution of HTTPS
- [Solved] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection…
- [Solved] cv2.xfeatures2d.SIFT_create() Error: module ‘cv2.cv2’ has no attribute ‘xfeatures2d’
- [Solved] Pycharm Use pip to install package error: no such option –build-dir
- [Solved] AttributeError: ‘Manager‘ object has no attribute ‘get_by_natural_key‘
- [Solved] Pytorch c++ Error: Error checking compiler version for cl: [WinError 2] System cannot find the specified file.
- [solution] pyinnstaller package EXE file tutorial
- [Solved] Python Project Error: django.core.exceptions.ImproperlyConfigured: WSGI application ‘WebTool.wsgi.application
- NPM install Error: gyp ERR! stack Error: Could not find any Python installation to use
- How to Solve Turtle_tf Error in ROS
- [How to Solve] ImportError: No module named typing
- Python Connect database error: command listdatabases requires authentication
- How to Solve Automatic error keyerror:***‘
- Python: ___ () vs ___ str__()
- [Solved] Mongodb security configurate error (unrecognized option: security)