I want to get the ui tree xml of an app running inside appsupport by using uiautomator. I got into the appsupport shell as root by using the command
[root@Xperia10V android_storage]# appsupport-attach
:/# id
uid=0(root) gid=0(root) groups=0(root)
When I execute the following command
:/# uiautomator dump
:/# echo $?
0
It shows it executed successfully but when I look in the standard dump folder /data/local/window_dump.xml there is nothing. On waydroid it shows a message too that the window has been succesfully dumped.
So I tried to find a way of logging in as a shell user like how it’s done with waydroid over adb because it doesn’t work as a root user on waydroid.
After finding the running container name of appsupport with this command.
Found a different way of executing uiautomator from my host PC. I got access to the android appsupport instance over adb. If you want to be able to connect to the android instance over adb you have to enter the following command to open the global android settings.
Then go to About Phone → Build Number, tap the Build Number seven times and you’ll see an on-screen countdown indicating how many more taps are needed. You’ll see a confirmation message when Developer options are enabled. Now go back to the settings menu and go to System there you’ll find a new menu entry called Developer Options where you can enable USB-debugging and Wireless Debugging. Now you can connect with adb from your host computer by the following command.
adb connect <phone-ip>:5555
adb devices
List of devices attached
<phone-ip>:5555 device
Now you can dump the ui tree from adb with uiautomator and retreive the xml.
Now I just have to figure out how to install adb on my phone to connect to the android instance. The system is aarch64 I can’t find a working adb binary for it yet.