Saagar Jha

If you’ve been trying to use xcrun simctl status_bar recently to take pretty screenshots and found that it doesn’t work past simulators running iOS 16.1, you can use “SIMCTL_CHILD_SIMULATOR_RUNTIME_VERSION=16.0 xcrun simctl boot” as a temporary workaround to get this back.
2 replies →
2 replies

Joachim Bondo

(replying to Saagar Jha)

@saagar @stroughtonsmith Great info (had I only known yesterday)!


yilei "dolee" yang

(replying to Saagar Jha)

@saagar Looks like SIMCTL_CHILD_SIMULATOR_RUNTIME_VERSION=16.0 no longer works in 17.0 (beta2), and they still haven't fixed this issue yet :(

Saagar Jha

(replying to yilei "dolee" yang)
@DoleeYang Ah, because they removed the 16.0 simulators? I’ll ping some of the people and see what’s up and if they have a better workaround

Saagar Jha

(replying to Saagar Jha)
The specific format for status bar overrides changes every so often, and Apple decided to shift the layout over by one byte in the 16.1 runtime. Normally, these updates are handled transparently by CoreSimulatorBridge, which converts things under the hood for you.

Saagar Jha

(replying to Saagar Jha)
They did so this time as well. There’s a class to handle the new format, “CSBStatusBarOverrides_iOS_Current”, and one that handles the older one, “CSBStatusBarOverrides_iOS_16”. The one that gets picked depends on the runtime your simulator is using, or SIMULATOR_RUNTIME_VERSION.

Saagar Jha

(replying to Saagar Jha)
Unfortunately, the corresponding changes in UIKitCore to read the new layout aren’t in the simulator runtimes. CoreSimulatorBridge forwards the overrides over in 16.1+ format, but the simulator sees it as the old 16.0 format, and generally fails to set the status bar correctly.

Saagar Jha

(replying to Saagar Jha)
Because of the off-by-one error, the command appears to not do anything. By pretending the simulator is running a 16.0 runtime, CoreSimulatorBridge will use the old format that _UIStatusBarDataConverter knows about and the override will be applied correctly. (FB12138918)