LLDB's po command is the essential tool when writing UI tests.
However, I got some errors when using po command on Xcode13 on M1 Mac.
(lldb) po app error: Couldn't realize type of app
Or, I got nothing.
(lldb) po app t = 425.92s Requesting snapshot of accessibility hierarchy for app with pid 90815 Find: Target Application 'com.bamboo-hero.SampleApp' // that's all. I could not get element tree.
How fix it?
I tried followings then fixed the problem
- Unchecking "Open using Rosetta" on Xcode.app
- deleting DerivedData
- building app
I'm debugging UI tests on iOS device, not on Simulator. So I don't need to use Rosetta on Xcode.
Then I deleted DerivedData folder to clean build files.
$ rm -fr ~/Library/Developer/Xcode/DerivedData/SampleApp-gfdtgwqbgmitwoacobrheufigmgd
Finally I built my app and po command worked perfectly!!
If you run into the same problem, try my solution!