Repository navigation
Description
Request: #1099
Problem
In the reporter's words: "A leased iOS simulator plays sound through the worker Mac's speakers. One of our agents ran a browser game on a leased simulator, and its music and effects played out loud on the Mac. … Android already has a switch for this, android.emulator.audio: false. Nothing does the same for an iOS simulator."
Who it is for
An operator whose worker Mac sits in a room with people (a desk machine, a shared office Mac running a pool of agents), and the agents leasing iOS simulators on it, with any app or page that plays sound.
Outcome
- A worker setting,
ios.simulator.audio(defaulttrue, as today), the iOS counterpart ofandroid.emulator.audio:falsekeeps every simulator on that worker silent, for every lease, with no change to what agents send. - The setting applies to every simulator Simlock makes ready for a lease after the daemon restarts: a new copy for a lease or the warm pool, and a leased device rebooted to recover it.
- A simulator made silent stays usable: apps and pages that play audio run as they do with sound, they are just not heard. An app sees its output volume at 0, as on an iPhone turned all the way down.
- When the command that silences a simulator fails, Simlock still grants the device, and the daemon log says so for that boot:
Could not silence iOS simulator, with the device and the reason.
How it works for the user
flowchart LR
O[Operator: simlock config set ios.simulator.audio false] --> R[restart the daemon]
R --> B[each simulator boots, then its volume is set to 0]
B --> L[agent leases it, plays a game]
L --> Q[nothing comes out of the Mac's speakers]
$ simlock config set ios.simulator.audio false
Updated ios.simulator.audio in ~/.simlock/config.json; takes effect on daemon restart.
Examples
ios.simulator.audio |
Today | After |
|---|---|---|
| unset | sound plays | sound plays |
true |
unknown key | sound plays |
false |
unknown key | silent |
"no" |
unknown key | invalid config, as any non-boolean |
What could go wrong
- A future Xcode ignores the volume setting, and simulators play sound again. Expected: the slow lane catches it on a new Xcode. An operator on an Xcode the slow lane has not run gets no warning; they hear it.
- An agent turns the volume back up, or reboots its leased simulator itself through
simlock simctl. Expected: it hears sound until Simlock next boots that device; Simlock does not watch the volume. - While an app plays sound on a silent simulator, the Mac still counts audio as playing and does not idle-sleep. Expected: as with sound; the configuration reference says so.
Words used
- silent: no sound from the simulator reaches the worker Mac's audio output; the app inside still plays, at volume 0.
- simulator volume: the simulated hardware volume, 0 to 100, default 60, inside a booted simulator. It resets to 60 on every boot.
Non-goals
- A per-lease
--mutedoption or a mute action on a lease (the request accepts a worker setting; an operator decides for the room). - Physical iPhones (their sound comes from the phone).
- Changing Android's
android.emulator.audio. - Recording or streaming a simulator's audio.
- Keeping a simulator silent after an agent changes its volume or reboots it outside Simlock.
- A
simlock doctorcheck: silence is checked on each boot instead, since only a booted simulator can show it.
Completion conditions
- With
ios.simulator.audio: false, every simulator Simlock makes ready for a lease reads volume 0 within 120 s of the grant (decided in delivery, pending the maintainer): the first lease's, a second lease's (a new copy), and one recovered by a reboot (slow lane). - With the setting unset, a simulator's volume is left as the simulator sets it.
- The configuration reference lists the key beside
android.emulator.audio.
Open questions
none
Decisions
none: one driver change and one config key; no ADR. The mechanism, found by the spike #1119 (findings: #1118 (comment)), lives in the iOS driver only.
Decided in the session:
- A simulator that cannot be made silent is granted with a warning in the daemon log, not failed (maintainer).
- The proof is the slow lane reading the volume back; no person's listening check (maintainer).
- No check that the volume took: the daemon warns only when the volume command fails; the slow lane proves the volume reads 0 on each new Xcode (maintainer).
Shared values
none: a one-task feature.
Behaviours
| Behaviour (invoker, action, what it sees) | Seam | Cases | Task |
|---|---|---|---|
An operator sets ios.simulator.audio and the daemon loads it and answers it in config.get |
loadConfig, config.get |
unset → true; true; false; "no" → invalid config naming the key; config.get returns ios.simulator.audio |
#1238 |
Simlock makes a simulator ready with ios.simulator.audio: false, and sets its volume to 0 before handing it on |
iOS driver makeReady |
prepare; recover; slim and full; the setting true → no notifyutil call; the volume command fails or times out → device ready, onSilenceFailed with the stderr or timed out |
#1238 |
| The daemon logs a silence failure | logSilenceFailure in daemon/main |
one failure gives one warn line Could not silence iOS simulator with deviceId and detail |
#1238 |
A leased simulator on a worker with ios.simulator.audio: false reads volume 0 |
slow lane | first lease; a second lease (a new copy); after a recovery reboot | #1238 |
Tasks
- ios.simulator.audio keeps every simulator silent #1238 —
ios.simulator.audiokeeps every simulator silent — an operator silences a worker's simulators. Risk: a simulator granted with sound and no warning.
Completion conditions: all three are #1238's.
Open work in the same area:
- iOS: every simulator is a copy of a seed, and every virtual device serves one lease #1204 (Named baselines: a lease starts from a device the operator prepared #327, PR feat(ios): every simulator is a copy of a seed, and every virtual device serves one lease #1210) changes
#bootAndWait, boots baseline sources through it, and makes each simulator serve one lease (no reclaim); this task adds a step after the boot inmakeReady, so it depends on iOS: every simulator is a copy of a seed, and every virtual device serves one lease #1204. Baseline sources are not silenced: a copy's volume starts at 60 and its ownmakeReadysilences it. - An operator saves, lists and removes baselines on a worker #1206, A lease names a baseline and gets a copy of it #1207 and A gateway routes a baseline request to a worker that holds it #1208 (Named baselines: a lease starts from a device the operator prepared #327) each bump the protocol; this task does too, so it depends on A gateway routes a baseline request to a worker that holds it #1208, the last of them.
- PR feat(android): android.emulator.hardwareKeyboard gives emulators a hardware keyboard #1082 (no issue) adds
android.emulator.hardwareKeyboardbesideandroid.emulator.audioin the same config block and contract shape; whichever merges second bumps the protocol again. No Depends on. - Console: see and change the daemon's settings, and restart it #1151 lists settings from the contract's config shape; the new key shows as a row with no change there.
Written by an agent.
Activity
V3RON commentedon Nov 3, 2026
Spike #1119: keep an iOS simulator silent (findings)
Run on 2026-11-03 on the maintainer's Mac (Darwin 25.6.0). Every simulator was booted the way Simlock boots one:
xcrun simctl --set /tmp/spike-1119-set boot <udid>thenbootstatus -b, with no Simulator.app. All spike devices, the scratch set and their overrides folders were deleted afterwards. The Mac's audio settings were not changed.DEVELOPER_DIR=/Applications/Xcode-26.4.1.app/Contents/Developer)Caveat: CoreSimulator is shared system-wide (
/Library/Developer/PrivateFrameworks), so both Xcodes ran on 1171.7, the version Xcode 27 installs. A Mac with only Xcode 26.4 runs an older CoreSimulator and was not tested here.How the simulator's audio reaches the Mac
coreaudiod, on the host output device named bysim_output_device_uid. coreaudiod's assertion names the app's own PID:com.apple.audio.iOSSimulatorAudioDevice-<pid>-0 … Resources: audio-out <host device UID>. For a web page, that PID iscom.apple.WebKit.GPU.<device>/data/var/run/simulatoraudio/audiosettings.plist(sim_output_device_uid,sim_volume,sim_ringer_state). The boot environment points to it throughSIMULATOR_AUDIO_SETTINGS_PATH.CoreSimulatorBridgewrites it from inside the simulator. Itssim_volumecomes from the simulator's notify statecom.apple.springboard.volumestate, which is the simulated hardware volume, 0–100, default 60. The in-simulator AudioToolbox and AudioSession apply that volume to every process's output, and they pick up a change live.SimAudioProcessorService.xpc, inside CoreSimulator, is the routing service that Simulator.app's Audio Output menu uses. Simlock does not run Simulator.app.How silence was measured
pmset -g assertions: coreaudiod'saudio-outassertion, which names the simulator process. It was absent before every run and appeared within 1 s of the test app starting. It went away when the app was terminated./tmp/spike-1119/tap/tap <pid> 3is a host CoreAudio process tap (CATapDescription(stereoMixdownOfProcesses:)on a private aggregate device, removed on exit). It measures the RMS and peak of the samples that one simulator process sends to coreaudiod. It needed no permission prompt in this session.simctl openurldid not work: autoplay is blocked without a tap (paused=true,AudioContext suspended). It still opened a host IO fromcom.apple.WebKit.GPU.swiftc(sources in/tmp/spike-1119/app/):AVAudioSession .playback. Printstick n running= rendered=<frames> vol=<outputVolume>every second.<audio>WAV + WebAudio oscillator). Each JS tick is sent back to stdout withpaused,currentTimeandAudioContext.state.renderedkept growing (~48k frames/s),running=true, the page saidpaused=falsewithcurrentTimeadvancing andac=running, and screenshots (simctl io screenshot) showed the app updating.Candidates
(a) Disable an audio daemon inside the simulator: does not work
com.apple.audio.systemsoundserver-simd, the only audio launchd job in the iOS 26.4 runtime's/System/Library/LaunchDaemons. Nothing inlaunchctl listis an audio server;mediaremotedandMediaRemoteUIhandle Now Playing.print-disabledconfirmed the label was disabled. The app and page still opened a host IO (assertion 6/6 s and 5/8 s,audio-out 34-0E-22-5B-D5-82:output) at volume 0.6. Apps talk to coreaudiod directly, so this daemon only serves system sounds.(b1) Route the simulator's output elsewhere: does not work
sim_output_device_uidinaudiosettings.plistwhile the simulator was booted; each new process reads it.34-0E-22-5B-D5-82:output).BuiltInMicrophoneDevice): no host IO, but AVAudioEngine fails to start (-10851,kAUInitialize), so the app breaks. Rejected.(b2) Simulated hardware volume = 0: works on both Xcodes (chosen)
Command, run after
bootstatus -b(it needs the simulator booted):CoreSimulatorBridgethen writessim_volume = 0toaudiosettings.plist. Writing the plist directly works only for processes started later, and is overwritten. Use the notify state.Silent? Yes, by sample level.
Page/app kept running: yes on both runtimes, with no hang or crash. Tone kept
running=trueand kept rendering. The page kept ticking withpaused=false,ac=runningandcurrentTimeadvancing. What an app sees:AVAudioSession.outputVolume == 0.0, the same as a user turning an iPhone all the way down.Live: switching volume 0 → 60 while the app played changed its
outputVolumewithin 1 s. A device silenced after an app has started is silenced right away.Host IO stays open: the coreaudiod
audio-outassertion is still present while silenced. The process streams zeros to the host device and holds a PreventUserIdleSystemSleep assertion while an app plays, as it does with sound.Survival:
simctl erase+ bootsimctl cloneof a silenced device + bootThe value lives only in in-memory notify state and in
var/run, so it must be re-applied after every boot: prepare, recover, after reclaim, and clones. Onesimctl spawntakes about 1 s.Slim conflict: none. On a device whose
disabled.plistdisabled all 171 labels ofSLIM_CATEGORIES(print-disabledshowed 171), the baseline still played (RMS 0.0509) and volume 0 gave RMS 0 for both app and page, on both runtimes. NeitherCoreSimulatorBridge, SpringBoard nor notifyd is in any slim category.Before re-applying after a boot, the device is at 60, so a sound started in that gap would be audible. In Simlock's flow no app runs before the grant, so applying it right after
bootstatus(before thelistappspoll) closes the gap.(c) Other things looked at
sim_ringer_state0 is the mute switch. It silences only ringer/ambient sounds;.playbackapps and pages still play. Not tested further.SIMCTL_CHILD_*/ boot environment: the in-simulator AudioToolbox reads onlySIMULATOR_AUDIO_SETTINGS_PATHandSIMULATOR_ROOT. CoreAudio has no environment switch to turn the HAL off.defaultsofcom.apple.iphonesimulator: its audio keys (RecentAudioOutputDeviceUIDs) are read only by Simulator.app. Nocom.apple.CoreSimulator.SimAudioProcessorServicedomain exists.device.plisthas no audio keys.simctlhas no audio subcommand.Chosen mechanism
Set the simulated hardware volume to 0 after every boot:
simctl spawn <udid> notifyutil -s com.apple.springboard.volumestate 0thennotifyutil -p com.apple.springboard.volumestate, run right afterbootstatuson everymakeReady(prepare and recover). It does not persist, so it must be applied every time. It works on iOS 26.4 (Xcode 26.4.1) and iOS 27.0 (Xcode 27.0), with or without slim. Apps and pages keep playing and seeoutputVolume == 0.Suggested readback for the implementation and for
doctor:simctl spawn <udid> notifyutil -g com.apple.springboard.volumestateshould print0, and<device>/data/var/run/simulatoraudio/audiosettings.plistshould havesim_volume = 0.Confidence: high on this Mac, because a baseline-checked sample-level measurement went from RMS ≈0.05 to exactly 0 on both runtimes. Medium for other setups, because both runs used CoreSimulator 1171.7 and the mechanism depends on two undocumented parts:
CoreSimulatorBridge's handling ofvolumestateand the runtime's handling ofsim_volume.Needs a person
On a worker Mac with speakers on, boot a simulator through Simlock with the setting off and confirm two things by ear:
notifyutil -s com.apple.springboard.volumestate 0+-p, while the app keeps ticking.Ideally do this once on a Mac with only Xcode 26.4 installed, so the older CoreSimulator is covered too.
Reproduction kit (left in /tmp, not in the repo)
/tmp/spike-1119/app/:Tone.app,WebTone.appand their sources (main.swift,web.swift)./tmp/spike-1119/tap/tap.swift: the host process-tap meter./tmp/spike-1119/meter.sh,run.sh,silence.sh: launch, measure and apply.Written by an agent.
V3RON commentedon Nov 3, 2026
Spec approved: the mechanism from the spike (volume 0 after every boot, checked in the background), Decisions, Behaviours and task #1238, checked ready. No ADR. #1238 waits on #1204 and #1208 (baselines stack).
Written by an agent.
V3RON commentedon Nov 3, 2026
Spec updated: the background read-back is dropped (maintainer). The daemon warns only when the volume command fails; the slow lane proves volume 0 on each new Xcode. Rechecked: feature and #1238 ready.
Written by an agent.
V3RON commentedon Nov 4, 2026
Delivery run
Merged: none
Parked: #1238 — slow lane: the second lease's simulator stays at volume 60; the hardware loop gave up after 13 failed lane runs (PR #1258, draft)
Written by an agent.
feat(ios): ios.simulator.audio keeps every simulator silent (#1258)
github-actions commentedon Nov 4, 2026
Closing: all 1 sub-issues are closed. The PR that closed the last one walks the completion conditions (delivery rule 9); reopen this if one does not hold on
main. Flip its ADRs to Accepted if delivery has not.V3RON commentedon Nov 4, 2026
Delivery run
Merged: #1258 (#1238)
Decided: #1238 — the volume lands 45 to 110 s after boot on a busy Mac, and "wait first" cannot catch it → (b) send once, grant at once; the slow lane waits 120 s and the configuration reference says "up to 2 minutes" (pending the maintainer; the alternative is to hold the grant until the volume reads 0)
This replaces the earlier park: the run resumed after the maintainer's answer.
Written by an agent.