solution: adjust to manual screenshot font>
principle: obtain the UI layout information of the current window and the screenshot of the current page through the ADB command, copy and send it to the computer, and then manually add the screenshot and file through uiautomatorview to analyze and locate the mobile phone elements font>
first step
You can first create a folder named test in the sdcard directory of your mobile phone font>
Step 2
open the CMD command line, and enter
adb shell uiautomator dump /sdcard/test/app.uix
# command explanation: output the UI layout information of the current window and input it to/sdcard/test/ app.uix Within the document( app.uix The file does not need to be created manually, and the command will be generated automatically). font> in this step, the CMD command line will report an error, but the final result will not be affected; font>
in the third step, the
adb shell screencap -p /sdcard/test/app.png
# command explanation: the ADB mobile phone screenshot command intercepts the current page and saves it to the mobile phone test folder (the mobile phone should be kept unlocked, otherwise the captured picture is pure black);
after completing these two steps, there should be two files in the/sdcard/test folder of the mobile phone
app.png Pictures captured for mobile phones
1 app.uix In order to capture the UI layout information of the image (later, the analysis elements can be operated through uiautomatiorview) font>
Step 4 of
adb pull /sdcard/test/app.uix E:/app.uix
?Command explanation: the app.uix File copy e disk font>
Step 5
adb pull /sdcard/test/app.png E:/app.png
Command explanation: copy the captured image to the e disk directory of the computer
at the same time, the two files of the computer should be as follows: font>
Step 6
Open UI autoviewer
screenshot select the PNG end picture of disk e, that is, the screenshot of the mobile phone
UI XML dump select the uix end file of disk e, that is, the layout information of the screenshot of the mobile phone font>
screen These commands can be written as bat files. You need to take a screenshot and run the bat file directly. The contents are as follows ( note: each saved screenshot will cover the previous screenshot font>):
@echo on
adb shell uiautomator dump /sdcard/test/app.uix
adb shell screencap -p /sdcard/test/app.png
adb pull /sdcard/test/app.uix E:/app.uix
adb pull /sdcard/test/app.png E:/app.png
Read More:
- Uiautomatiorviewer connect to the machine and click to report unexpected error while observing UI hierarchy
- Error reporting UI hierarchy using uiautomatorviewer
- uiautomatorviewer:Error while obtaining UI hierarchy XML file:com.android.ddmlib.SyncException:
- [Solved] uiautomateviewer Tool Error: Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException
- Error (12153): Can‘t elaborate top-level user hierarchy
- Unexpected syntax error: unexpected token<
- [development experience] solution to unexpected syntax error: unexpected identifier in JSON parsing
- Binary tree traversal (preorder, middle order, postorder, hierarchy traversal, depth first, breadth first)
- “Unexpected syntax error: unexpected identifier”.
- Solve the problem of syntax error: unexpected end of file or syntax error near unexpected token ` fi ‘error
- [Fixed] Unity error CS1704: An assembly with the same name `UnityEngine.UI’ has already been imported
- The scan of annotations for web application [] could not be completed due to a stackoverflower error. Possible root causes include the low setting of – XSS and illegal circular inheritance dependencies. The class hierarchy being processed is
- Invalid use of element UI icon by vite
- The togglerowexpansion method of the table of element UI expands the specified row
- Vue element UI uses this. $notify is not a function problem resolution using the notification box
- Python AttributeError: ‘bool‘ object has no attribute ‘ui‘
- Elememt UI introduces components on demand to report errors
- Idea stuck and error reported: UI was frozen for xxxxx MS problem solving
- Error: unexpected syntax error: unexpected token<
- error CS0234: The type or namespace name ‘UI‘ does not exist in the namespace ‘UnityEngine‘