iosreact-nativeios-simulatorstatusbar

How to change status bar on iOS Simulator to Apple default like time: 9:41


I want to take Screenshots with different devices. Is there like a terminal command to change the status bar manually. I know there is xcrun but how do I use it?


Solution

  • Here is the command you need to run on your terminal :

    xcrun simctl status_bar booted override --time "9:41" --batteryState charged --batteryLevel 100 --cellularBars 4

    This will change the values for all booted simulators.

    You can replace 'booted' by the device name (example "iPhone 11 Pro"), or by the UUID of the simulator.

    ( xcrun simctl list | grep Booted to find UUIDs of running simulators)

    And voilĂ  ! You can also change the values for the time and the battery if you want to :)