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:
- How to Solve Python picamera and raspistill error
- [Solved] AttributeError: ‘Manager‘ object has no attribute ‘get_by_natural_key‘
- Using Python error urlopen error unknown URL type: the solution of HTTPS
- Python: ___ () vs ___ str__()
- Invalid python sd, Fatal Python error: init_fs_encoding: failed to get the Python cod [How to Solve]
- npm install Error: stack Error: Can’t find Python executable “python”
- [Solved] Error when installing pycurl in MAC: Command ‘clang’ failed with exit status 1
- How to Solve Turtle_tf Error in ROS
- Change the Python installation path in Pycharm
- Python Connect database error: command listdatabases requires authentication
- Python 2.7: How to Install PIP
- Python requests Error: ConnectionError: (‘Connection aborted.‘, error(104, ‘Connection reset by peer‘))
- [Solved] Pycharm Use pip to install package error: no such option –build-dir
- Error in sitecustomize set PYTHONVERBOSE for traceback KeyError: ‘PYTHONPATH’
- Chromdriver Install error: File “C:\python37\lib\site-packages\selenium\webdriver\common\service.py”, line 76, in start stdin=PIPE) File…
- Django Issues: TypeError: “Settings” object is irreversible
- [Solved] django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.Did you install mysqlclie
- [Solved] ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
- Python PIP TypeError: expected str, bytes or os.PathLike object, not int
- linux ubuntu pip search Fault: <Fault -32500: “RuntimeError: PyPI‘s XMLRPC API is currently disab