Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing or removing the carrier name on the iOS simulator using xcrun simctl status_bar

As of iOS 13, SimulatorStatusMagic no longer works, but happily Apple have provided a first-party solution through simctl status_bar.

However I can't find any way to remove or change the "Carrier" text:

iOS 13 Status Bar

Setting --cellularMode notSupported removes it, but it also removes the cellular bars.

Is there any way to reproduce the previous functionality of SimulatorStatusMagic and remove or change just the carrier name?

Edit: Xcode 11.4 includes a new parameter to set the operator name, though it doesn't seem to work. The documentation provides the following:

    --operatorName <string>
         Set the cellular operator/carrier name. Use '' for the empty string.
like image 467
Robert Avatar asked Sep 27 '19 14:09

Robert


People also ask

What is Xcrun Simctl?

xcrun simctl is command utils to control iOS simulator, just like adb for Android. Sometimes, in CI server script, We need these simulator-integration command to interact with simulators and run test cases. If we run xcrun simctl help , here are some subcommands.

What are the two ways to access iOS simulator in Xcode?

There are two different ways to access Simulator through Xcode. The first way is to run your app in Simulator, and the second way is to launch Simulator without running an app.

Where is device and simulator in Xcode?

The basic way to open a list of simulators is to use Xcode -> Window -> Devices and Simulators.


1 Answers

I was able to remove the carrier name by passing not an empty string to operatorName but a string with just a space ' '

However, using operatorName alone will not have any effect. You also need to activate cellularMode.

For Example

xcrun simctl status_bar "iPhone 8 Plus" override --operatorName ' '

gives this result

enter image description here

whereas

xcrun simctl status_bar "iPhone 8 Plus" override --operatorName ' ' --cellularMode active

results in this

enter image description here

like image 199
ergoon Avatar answered Sep 20 '22 17:09

ergoon