feat(settings): set the time zone on iOS simulators and Android
Merged
IM
2d ago+713+713+012345678901234567890123456789-45-45-01234567890123456789
Summary
Adds settings timezone <iana-zone|reset> for iPhone and iPad simulators and Android devices and emulators, and introduces the value settings catalog form that drives usage, help, client types, and MCP metadata. Values must be a zone Intl knows, kept as written (offsets and unknown names are refused before dispatch), and --app is refused with setting_app_not_consumed. Each response reports previousTimeZone.
- iOS simulator: sets or unsets
TZin simulatorlaunchdviasimctl spawn launchctl. Applies only to apps launched afterwards and is lost when the simulator reboots; both limits are documented in CLI help and docs. A zone missing from the Mac's time zone database, which simulator apps read, fails withtime-zone-unknown-to-simulator. - Android: works on emulators, physical devices, and Limrun Android over adb. Turns
auto_time_zoneoff, runscmd alarm set-timezone, verifiespersist.sys.timezone(failing withtime-zone-not-applied; any failure restores the previousauto_time_zone), and re-enables automatic time zone onreset. - Other targets (including Limrun iOS, tvOS, macOS, and Revyl) refuse with
UNSUPPORTED_OPERATION.
Before / after
$ agent-device settings timezone America/New_York --platform android --json
-Error (INVALID_ARGS): settings requires <wifi|bluetooth|airplane|mobile-data|keep-awake|location|animations> <on|off>, …
+{"setting":"timezone","state":"America/New_York","timeZone":"America/New_York","previousTimeZone":"Asia/Kolkata","autoTimeZone":false,"message":"Time zone set to America/New_York"}
$ agent-device settings timezone asia/kolkata --platform android --json
-Error (INVALID_ARGS): settings requires <wifi|bluetooth|airplane|mobile-data|keep-awake|location|animations> <on|off>, …
+Error (COMMAND_FAILED, reason=time-zone-not-applied): Android kept the time zone America/New_York.
$ agent-device settings timezone Asia/Kolkata --platform ios --json
-Error (INVALID_ARGS): settings requires <wifi|bluetooth|airplane|mobile-data|keep-awake|location|animations> <on|off>, …
+{"setting":"timezone","state":"Asia/Kolkata","timeZone":"Asia/Kolkata","previousTimeZone":null,"warnings":["Running apps keep the old time zone until they relaunch (run open <app> --relaunch), and the override is lost when the simulator reboots."],"message":"Time zone set to Asia/Kolkata"}
Validation
- Base
9f7751eeb0, headf9f8282018. - Pixel 9 emulator (API 36):
America/New_York, lowercase alias read-back (time-zone-not-applied), andresetverified withgetprop persist.sys.timezoneandauto_time_zone. - iPhone 17 Pro simulator (iOS 27.2):
Asia/Kolkataandresetverified withlaunchctl getenv TZ;resetwarns about relaunching only. - Focused suites: 219 passed (contracts, command-surface, daemon handler, Apple, Android, Limrun); 21 mutants each fail a test, including physical Android admission.
- Gate at
f9f8282018:format,lint,typecheck,layering,fallow,build,vitest-related,provider-integration(324 passed),command-docs,docs-links, anddocs-prosepassed.