Wednesday, June 2, 2021

Slow Testing With Xcode 12.5 and Big Sur


When running app in iOS 14.5 simulator launch takes incredibly long time (more than 30 seconds). In comparison launching installed app in simulator - 2 seconds, launching app on the real device (iOS 14.4) - 6 seconds.


When running against simulator Xcode says “launching app”, “attaching to app”, and then “running app”, at the running app stage we get a ~30 second pause. debugserver at 100% activity at that time.

Via Chris Fish:

I have noticed that our regular dev lifecycle has tanked significantly since updating to 11.3. It takes up to 10 seconds to attach the debugger. If I run the app without attaching the debugger automatically it flies.

This is reported as starting with macOS 11.3. I didn’t see any problems with that version, but since updating to macOS 11.4 I’ve seen incredible slowness testing my Mac code. Running an individual unit test used to be almost instantaneous. Now there is a delay of 10 seconds or so between launching xctest (i.e. when Xcode starts showing “Testing…”) and when the test actually begins running. Turning off “Debug executable” doesn’t help. Sampling the process shows that xctest is waiting for the access() call, as it tries to load my test bundle. Meanwhile, the tccd process pegs the CPU.

I guess the problem must be triggered by something in my project—or perhaps just its (modest though non-trivial) size—since it doesn’t occur with a fresh project (though even that has high CPU use for tccd). I’m not sure what TCC doesn’t like. The test bundle and all the frameworks that it links to are code signed. The delay occurs on three different Macs, one of them a clean installation.

Another Xcode 12.5 issue: the “Run ‘Test/Class’” command (Command-Control-Option-U) is always disabled, even though Xcode shows the tests and I can run them by clicking the diamond.


Update (2021-06-05): Ashley Bischoff:

Just as an eensy correction to the quoted article—I believe that Full Disk Access may have been introduced in macOS 10.14 Mojave?


7 Comments RSS · Twitter

There was a recent change committed to LLDB's debugserver that claims to address a performance regression due to a change in macOS 11.3 to a dyld SPI that debugserver uses. See for details. It's not clear when it will make it into an Xcode release.

Oh good, it’s not just me seeing this. It’s really killing my productivity on UI changes that need repeated running to see how changes look.

Xcode Slow Man

Thanks for this informative post.
And thanks Mark for the commit reference, hopefully Apple fix this ASAP.

Is this also true on Apple Silicon, or is it Intel only?

Same problem. My project is very simple and code size is very very small. I didn't run into this problem until I upgrade my os to Big sur 11.4 (with xCode 12.5, iOS simulator 14.5) :(

I believe I've just run into this today on MacOS 12.3.1, Xcode 13.3.1.

Unit tests for *my* modest but non-trivial MacOS Framework take about 10 extra seconds to run, but *only when there's at least one assertion failure*. When there are no failures, the entire suite runs nearly instantaneously… gah!

@Todd Sounds like a different issue because for me the delay is before it even begins running the test, before it knows whether there will be any failures.

Leave a Comment