This morning I've been updating the screenshots for the latest update of Avoid Town which adds among other things support for Dark Mode on iOS 13.
I've been using Simulator Status Magic for as long as I can remember to clean up the status bar — this involves removing the Carrier name, setting the battery to 100% and full bars. For some reason this wasn't working, so I started looking into it and found the following:
Xcode 11 beta 4 includes support for perfect status bars without SimulatorStatusMagic! 🎉 Run xcrun simctl status_bar with beta 4 or later installed and rejoice! This project will be going away soon, which is great news.
Looks like the time has finally come to wave goodbye to Simulator Status Magic. Its been a great run and you served us well, thank you for your service 👋😄
The xcrun simctl status_bar
tool allows us to override the status bar with several options:
time <string> Set the date or time to a fixed value. If the string is a valid ISO date string it will also set the date on relevant devices.
dataNetwork <string> If specified must be one of 'wifi', '3g', '4g', 'lte', 'lte-a', or 'lte+'.
wifiMode <string> If specified must be one of 'searching', 'failed', or 'active'.
wifiBars <int> If specified must be 0-3.
cellularMode <string> If specified must be one of 'notSupported', 'searching', 'failed', or 'active'.
cellularBars <int> If specified must be 0-4.
batteryState <string> If specified must be one of 'charging', 'charged', or 'discharging'.
batteryLevel <int> If specified must be 0-100.
My first attempt was the following:
xcrun simctl status_bar 'iPhone 11' override --time '9:41' --dataNetwork 'lte' --batteryState 'charged' --cellularMode 'active'
This sets the time to 9:41, using LTE with a full battery. This looks great on iPhone X and later.
However, on older devices this still shows the Carrier name.
I really dislike showing the Carrier name and it doesn't look like there is a way of removing it using simctl override
, so instead I opted for the following:
xcrun simctl status_bar 'iPhone 11' override --time '9:41' --dataNetwork 'wifi' --batteryState 'charged' --cellularMode 'notSupported' --wifiMode 'active' --wifiBars 3
This sets the time to 9:41, using Wifi with a full battery.
Personally I prefer showing LTE and bars, but this doesn't appear to be possible without also showing the Carrier name which seemingly we can't remove so this is a fine compromise.
Another option is to vary what we do depending on if the device has a notch or not. I'm currently trying to figure out how to automate this with Fastlane.
Update (Sep 18, 2019): I wrote about how I automated this with Fastlane / Snapshot here.