I noticed that applications run in the Xcode simulator will inherit the battery level and charging status from the OS of the host machine. Is there any way to override or set the battery level when running in the simulator?
I did come across this module here, but I am looking for a simpler solution that would give me more customization according to my needs for different iPhones. https://github.com/shinydevelopment/SimulatorStatusMagic
As of Xcode 11 (beta 4), you can use the command line to set time and battery level.
xcrun simctl status_bar <device> override --time "9:41" --batteryState charged --batteryLevel 100
See the Simulator New Features section in Xcode 11 beta 4 release notes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With