Skip to content

feat(settings): set the time zone on iOS simulators and Android - #5127

Merged
thymikee merged 8 commits into
callstack:mainfrom
imranbarbhuiya:feat/settings-timezone
Nov 26, 2026
Merged

thymikee merged 8 commits into
callstack:mainfrom
imranbarbhuiya:feat/settings-timezone

Conversation

@imranbarbhuiya

@imranbarbhuiya imranbarbhuiya commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Refs #5005. Split from #5050.

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 TZ in simulator launchd via simctl 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 with time-zone-unknown-to-simulator.
  • Android: works on emulators, physical devices, and Limrun Android over adb. Turns auto_time_zone off, runs cmd alarm set-timezone, verifies persist.sys.timezone (failing with time-zone-not-applied; any failure restores the previous auto_time_zone), and re-enables automatic time zone on reset.
  • 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, head f9f8282018.
  • Pixel 9 emulator (API 36): America/New_York, lowercase alias read-back (time-zone-not-applied), and reset verified with getprop persist.sys.timezone and auto_time_zone.
  • iPhone 17 Pro simulator (iOS 27.2): Asia/Kolkata and reset verified with launchctl getenv TZ; reset warns 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, and docs-prose passed.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 29 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread website/docs/docs/commands.md Resolved
@thymikee

Copy link
Copy Markdown
Member

Thanks for the contribution. At a974543, no new blocking problem was found, but open review threads still apply, including a high-priority one.

These high-priority threads still stand: Android auto-time restore, reset docs wording, reset test strength, happy-path test state and iOS zone validation. 1 lower-priority thread also still applies. This thread does not apply and can be resolved: the display-name sentence already exists on the base branch, and this PR only adds bluetooth and timezone to the refusal list.

All code jobs pass. Two Body rules runs were cancelled because later runs replaced them after PR edits. That check covers the PR description, not the code, so the cancellations look unrelated to this change.

Not verified here: the live emulator and simulator runs, which only the author has reported. Not verified here: physical Android admission on a live device (it was checked from runtime facts and a mocked test). Not verified here: the Revyl refusal and the Android "status bar updates at once" doc sentence on a live run.

@thymikee

Copy link
Copy Markdown
Member

Thanks for the fixes. No code problems that need a change before merge were found at f9f8282, and the points from the earlier review are addressed.

None of the open inline threads still applies, so they can be resolved: this one is fixed by the restore on failure and its transport-drop test; this one by the docs now saying the previous automatic time zone setting is put back; this one and this one by the new negative assertions on auto_time_zone; this one by the host zoneinfo check before launchctl and its test; this one needs no change, because the display-name sentence already exists on the base branch and this PR only adds bluetooth and timezone to the refusal list; this one is fixed by the timeZone null assertion in the Android end-to-end scenario.

All code jobs pass at this commit. The one check that is not passing, Body rules, was cancelled because a later run replaced it after a PR edit. It checks the PR description, and the diff does not touch what it runs.

The required evidence is in place. The live emulator and simulator runs are reported by the author only. Not verified here: the new restore after a transport drop and the iOS refusal path were checked from code and unit tests, not on a device. Tests were not run locally; CI ran them successfully at this commit.

Nothing needs to change before merge. As an optional follow-up issue: could the iOS zoneinfo check on the host disagree with an SDK consumer's scoped Apple tool provider? Not verified here: this is inferred from how the provider scope is wired, and not every such consumer was traced.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 26, 2026
@thymikee
thymikee merged commit 0b5627d into callstack:main Nov 26, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants