Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

simtime

Utilities for setting and clearing the iOS Simulator status bar time across all currently running (booted) simulators. Useful for consistent screenshots, demos, and UI tests.

Features

  • Set a fixed clock time on every booted iOS simulator (simtime.py).
  • Clear status bar overrides on every booted iOS simulator (simclear.py).
  • Works with multiple simulators at once.

Requirements

  • macOS with Xcode installed (includes the iOS Simulator).
  • Xcode command line tools with xcrun available.
  • Python 3.8+.

You can verify simctl availability with:

xcrun simctl help status_bar

Quick Start

  1. Boot one or more iOS simulators (for example):
open -a Simulator
# or boot a specific device
xcrun simctl boot "iPhone 15"
  1. Set a fixed clock time (24‑hour HH:MM):
python3 simtime.py 09:41
  1. Clear the status bar override when finished:
python3 simclear.py

Scripts

  • simtime.py

    • Sets the status bar time for each booted iOS simulator via xcrun simctl status_bar <UDID> override --time <HH:MM>.
    • Validates basic time format HH:MM (24-hour).
    • Skips non‑iOS devices and only affects booted simulators.
  • simclear.py

    • Clears the status bar override for each booted iOS simulator via xcrun simctl status_bar <device> clear.
    • Only affects booted simulators.

Examples

  • Set time to 02:25 across all booted simulators:
python3 simtime.py 02:25
  • Clear time/status bar override across all booted simulators:
python3 simclear.py

Notes

  • These scripts override only the status bar time; they do not change the simulator’s system clock or timezone.
  • If no simulators are booted, the scripts will print a helpful message and exit.
  • Device matching in simctl can use either UDID or name; using UDID avoids ambiguity when multiple devices share the same name.

Troubleshooting

  • xcrun: error: unable to find utility "simctl" → Ensure Xcode and its command line tools are installed, then run xcode-select --install or select the correct developer path via sudo xcode-select -s /Applications/Xcode.app.
  • "No running iOS simulators found" → Launch one with open -a Simulator or xcrun simctl boot <device>.
  • Time format must be HH:MM (e.g., 09:41).

Why

Consistent clock time is often required for screenshots, marketing assets, documentation, and visual diffs in UI testing. These utilities make that repeatable across multiple simulators with a single command.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages