Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make the iOS simulator battery show 100%?

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

like image 253
Christian Avatar asked May 01 '18 15:05

Christian


1 Answers

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

like image 109
robmathers Avatar answered Oct 04 '22 15:10

robmathers