Need to quickly change the iOS Simulator’s status bar for screenshots or testing? You can do it with the simctl
command-line tool. Here’s a quick look.
The Basic Command
The core command to manipulate the status bar is:
xcrun simctl status_bar <device> override <options>
<device>
: Usebooted
for the currently running simulator, or a specific simulator UDID (get a list withxcrun simctl list devices
).<options>
: These are key-value pairs for what you want to change.
Common Status Bar Overrides
Here are some of the most common things you’ll want to do:
1. Set the Time
Classic Apple screenshot time? Easy. The 9:41 AM time is a nod to when Steve Jobs first unveiled the iPhone.
# Set time to 9:41 AM
xcrun simctl status_bar booted override --time "9:41"
2. Cellular Data Network Type
Show 5G, LTE, 4G, etc.
# Show 5G
xcrun simctl status_bar booted override --dataNetwork "5g"
# Show LTE
xcrun simctl status_bar booted override --dataNetwork "lte"
(Other options: 4g
, 3g
, wifi
)
3. Wi-Fi Indicator
Control Wi-Fi appearance.
# Show Wi-Fi connected with 3 bars
xcrun simctl status_bar booted override --wifiMode active --wifiBars 3
--wifiMode
:searching
,active
,failed
--wifiBars
: 0 to 3
4. Cellular Signal
Control cellular bars.
# Show 4 bars of cellular signal (LTE)
xcrun simctl status_bar booted override --cellularMode active --cellularBars 4 --dataNetwork "lte"
--cellularMode
:notSupported
,searching
,failed
,active
,limited
--cellularBars
: 0 to 4
5. Battery State and Level
Set battery appearance.
# Battery 100% and charging
xcrun simctl status_bar booted override --batteryState charging --batteryLevel 100
# Battery 20% and unplugged
xcrun simctl status_bar booted override --batteryState discharging --batteryLevel 20
# Battery 10%, unplugged, and low power mode
xcrun simctl status_bar booted override --batteryState discharging --batteryLevel 10 --lowPowerMode 1
--batteryState
:charging
,charged
,discharging
--batteryLevel
: 0 to 100--lowPowerMode
:1
(on),0
(off)
Putting It All Together (Screenshot Mode)
For that perfect App Store screenshot, Apple generally recommends showing a clean status bar with full Wi-Fi or cellular signal, a full battery, and no carrier name. The 9:41 AM time is also a common touch.
xcrun simctl status_bar booted override \
--time "9:41" \
--dataNetwork "wifi" \
--wifiMode active \
--wifiBars 3 \
--operatorName "" \
--batteryState charged \
--batteryLevel 100
Clearing Overrides
To go back to the normal status bar:
xcrun simctl status_bar booted clear
Shortcut for Recommended State
To make this even faster, you can create a shell alias. For example, if you’re using zsh, add this to your ~/.zshrc
file:
alias setcleanstatus='xcrun simctl status_bar booted override --time "9:41" --dataNetwork "wifi" --wifiMode active --wifiBars 3 --operatorName "" --batteryState charged --batteryLevel 100'
Then, after running source ~/.zshrc
, you can just type setcleanstatus
in your terminal. You could create a similar alias like clearstatus
for the clear
command.
Quick Troubleshooting
simctl
not found? Usexcrun simctl
or check your Xcode command-line tools setup (xcode-select -p
).- “Unable to find a booted device”? Make sure your simulator is running. Or, use its UDID.
- Overrides not working? Double-check option names with
xcrun simctl status_bar --help
. Ensure the simulator is active.
That’s it! Quick and actionable simctl
commands for status bar mastery.