BambooHero

#Programming #iOS #Investment #LifeHacks

LLDB's po command not work on Xcode13 M1 Mac. How to fix it?

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

  1. Unchecking "Open using Rosetta" on Xcode.app
  2. deleting DerivedData
  3. building app


I'm debugging UI tests on iOS device, not on Simulator. So I don't need to use Rosetta on Xcode.

f:id:bamboohero:20220409124227p:plain


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!