UI hierarchy visualization tool, supporting Android, iOS, HarmonyOS NEXT.
Project description
ui-viewer
UI hierarchy inspector, supporting Android
, iOS
, and HarmonyOS NEXT
.
Its features include:
- visualize the UI hierarchy via screenshot and tree structure.
- view element properties
- auto generate XPath or XPathLite
- auto generate coordinate percentages.
- and more…
This project is developed using FastAPI and Vue. It starts locally and displays UI hierarchy through web browser.
Installation
- python3.8+
pip3 install -U uiviewer
Run
Run the following command on the terminal. (default port 8000
)
uiviewer
# or
python3 -m uiviewer
INFO: Started server process [46814]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: 127.0.0.1:55080 - "GET / HTTP/1.1" 307 Temporary Redirect
INFO: 127.0.0.1:55080 - "GET /static/index.html HTTP/1.1" 200 OK
INFO: 127.0.0.1:55080 - "GET /static/css/style.css HTTP/1.1" 200 OK
INFO: 127.0.0.1:55080 - "GET /static/js/index.js HTTP/1.1" 200 OK
INFO: 127.0.0.1:55080 - "GET /static/js/api.js HTTP/1.1" 200 OK
INFO: 127.0.0.1:55082 - "GET /static/js/utils.js HTTP/1.1" 200 OK
INFO: 127.0.0.1:55082 - "GET /static/js/config.js HTTP/1.1" 200 OK
INFO: 127.0.0.1:55082 - "GET /version HTTP/1.1" 200 OK
And then open the browser to http://localhost:8000
You can also customize port to start the service.
uiviewer -p <PORT>
# or
python3 -m uiviewer -p <PORT>
Tips
-
If you are using a virtual environment, please make sure to activate it before running the command.
-
On iOS, please ensure that WDA is successfully started and wda port forwarding is successful in advance.
- First, Use
xcode
ortidevice
orgo-ios
to launch wda.
tidevice xctest -B <wda_bundle_id>
- Second, Use
tidevice
oriproxy
to forward the wda port,and keep it running.
tidevice relay 8100 8100
- And then, To ensure the success of the browser to access
http://localhost:8100/status
, return like this:
{ "value": { "build": { "productBundleIdentifier": "com.facebook.WebDriverAgentRunner", "time": "Mar 25 2024 15:17:30" }, ... "state": "success", "ready": true }, "sessionId": null }
- Finally, Input the
wdaUrl
in the web page, such ashttp://localhost:8100
- First, Use
-
On iOS,WDA can easily freeze when dumping high UI hierarchy. You can reduce the
maxDepth
on the web page. The default is 30.
Preview
-
HarmonyOS
-
Android
-
iOS
Relevant
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file uiviewer-1.1.1.tar.gz
.
File metadata
- Download URL: uiviewer-1.1.1.tar.gz
- Upload date:
- Size: 409.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c964c029e3e468147ca619930c35be3af6465b696086d154cf2d082a556a7c4b |
|
MD5 | 9369c5c082610e30661fb628999574a4 |
|
BLAKE2b-256 | 2acc483736c64d351d82f50c061e26b9f3146c67012c5320b20a63d9f78c926c |
File details
Details for the file uiviewer-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: uiviewer-1.1.1-py3-none-any.whl
- Upload date:
- Size: 423.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae87b007c54a0e90f41403b41fccbcf7d98e124cafbe6e9b87d065ec499a550d |
|
MD5 | 84ae3cd5ba4a76608c0f0e1a9d807224 |
|
BLAKE2b-256 | 64eda96a9ec6dbce30165bf47a29a57b88c496ef29cdacad7f13cfb0b2492bd0 |