INNER CODE UNIT · TypeScript
launchMuteOnlyTap
jo-duchan/tapflow · packages/audiotap-helper/src/index.ts:103
export function launchMuteOnlyTap(appPath: string, pids: number[]): void {
execFileSync('open', ['-g', '-n', '-a', appPath, '--args', '--mute-only', ...pids.map(String)],
{ stdio: ['ignore', 'ignore', 'ignore'] })
}
// Core Audio process taps need macOS 14.2+ (Darwin 23.2+). os.release() → "<darwinMajor>.<minor>.…".
export function isAudioSupported(): boolean {
const [maj, min] = os.release().split('.').map(Number)
return maj > 23 || (maj === 23 && min >= 2)
}
/**
* Prime the audio-capture TCC grant up front (from `tapflow setup ios` / `tapflow agent start`) so the
* operator approves it while present — not at first simulator boot, which a headless operator would miss.
*
* Runs the helper's --request-permission mode: a global tap whose *capture start* raises the same
* audio-capture prompt a per-pid tap needs (the grant keys on the app cdhash + service, not the tap
* shape), so no port/pid/booted simulator is required. The grant isn't readable back, so the caller