I had tried many solutions online. but they do not work. here is my working solution I found finally.
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.