Run a command on a Mac
exec_macRuns an argv command on the Mac as the agent user. Waits up to wait_seconds (default 20, max 50): a command that ends in time returns exit_code, stdout and stderr (first 64 KiB each); a longer one returns a job that keeps running (get_mac_job). Shell syntax needs ["/bin/bash", "-lc", "..."]. A command is at most 64 KiB. The same request_key and arguments return the same job, never a second run. A command ends with what it started; ["nomac-service", "start", "api", "--", ...] keeps a server running.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Folder to run in: relative to the workspace (the default), ~/… or absolute, such as ~/drive/src/app. | |
| argv | Yes | Command and arguments, for example ["bash", "-lc", "xcodebuild -list"]. | |
| session_id | No | Mac session ID (ses_…). Optional: without it, the account's running Mac. | |
| request_key | Yes | Idempotency key you choose (8-128 letters, digits and - _ . :). Repeat a lost call with the same key and arguments; a new key is new work. | |
| wait_seconds | No | Wait this long (0-50, default 20; 40 for builds and tests) for the command to finish and return its output in this call. | |
| timeout_seconds | No | Stop the command after this many seconds (1-3600, default 300). Builds and test runs: up to an hour. |