I had tried many solutions online. but they do not work. here is my working solution I found finally.
Solution:
1. First, make sure that ADB devices can query your device
2. Key solution: delete ATX on the mobile phone and re-execute python -m uiautomator2 init
3. Just in case, don’t directly execute the WebEditor. Be sure to execute python -m weditor
Then click Dump Hierarchy to synchronize the screen. Don’t use real-time, just use static.
Read More:
- [Solved] XiaoMi Phone Uiautomator Startup Error: uiautomator2.GatewayError
- [Solved] uiautomatorviewer Error: Error obtaining UI hierarchy
- [Solved] Pyinstaller packaged exe error: “failed to execute script XXX”
- [Solved] Pytest Error: E ModuleNotFoundError: No module named ‘common
- [Solved] AttributeError: ‘Manager‘ object has no attribute ‘get_by_natural_key‘
- Python: Django exception when executing migrate operation: django.db.utils.OperationalError: (1051, “Unknown table’xxx’”)
- [Solved] Python Project Import Module Error: ModuleNotFoundError
- [Solved] From pip._internal import cmdoptions ImportError: cannot import name SourceDistribution
- How to Solve cv2.applyColorMap Error
- [Solved] MAC terminal Use ‘CONDA activate’ and ‘CONDA install package_ Error reported by name’ Error
- How to Solve Automatic error keyerror:***‘
- [Solved] AttributeError: module ‘logging‘ has no attribute ‘Handler‘
- VScode Run CONDA environment Error [How to Solve]
- Python classes that connect to the database
- Python parses XML files (parses, updates, writes)
- How to Solve RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED
- [Solved] selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn
- Python 2.7: How to Install PIP
- [Solved] Selenium.common.exceptions.WebDriverException: Message: newSession
- [Solved] Pycharm Use pip Error: Script file ‘D:\Anaconda3\envs\pytorch\Scripts\pip-script.py‘ is not present