DeviceFarmer / stf

Control and manage Android devices from your browser.
https://devicefarmer.github.io
Other
3.51k stars 496 forks source link

how to get android page resource by stf #796

Open amoxuk opened 4 months ago

amoxuk commented 4 months ago

Describe the solution you'd like

I want to get the android page resource by stf, is there any api to make it ? or minicap? otherwise I will make it by appium.

denis99999 commented 4 months ago

@amoxuk , I don't understand, can you detail your question ?

csdaa commented 4 months ago

image

He needs to get the xml structure of the page layout, similar to the file generated by the "UI Automator Viewer". Someone pushed this feature a few years ago, but it was rejected because of non-standard coding.Right? @amoxuk

amoxuk commented 4 months ago

image

He needs to get the xml structure of the page layout, similar to the file generated by the "UI Automator Viewer". Someone pushed this feature a few years ago, but it was rejected because of non-standard coding.Right? @amoxuk

completely right! thank you!

csdaa commented 4 months ago

image He needs to get the xml structure of the page layout, similar to the file generated by the "UI Automator Viewer". Someone pushed this feature a few years ago, but it was rejected because of non-standard coding.Right? @amoxuk

completely right! thank you!

I developed this feature during business hours, so I can't expose the code to you, or if you look for a record of a pull request before STF. My thoughts:

  1. Take a screenshot through the virtual screen of STF
  2. Get the XML of the page through ADB and store it in TMP, and then read the XML file just saved
amoxuk commented 4 months ago

@csdaa it's too slow by adb dump&read. I had verified this method. So I want some efficient method.

csdaa commented 3 months ago

@csdaa it's too slow by adb dump&read. I had verified this method. So I want some efficient method.

try this uiautomator dump /data/local/tmp/uidump.xml