Prevents Bluetooth audio devices (e.g. AirPods) from hijacking the default macOS microphone.
Beta: MicGuard is pre-1.0. Backward compatibility is not guaranteed until version 1.0.0 is reached.
- macOS 15+
brew install pszypowicz/tap/mic-guardRelease builds are signed with a Developer ID certificate and notarized, so Gatekeeper accepts them as-is.
Grab MicGuard.dmg from the latest release, open it, and drag MicGuard into Applications.
make installMicGuard is a macOS menubar app that monitors the default input device via CoreAudio. When the system switches the input (e.g. when AirPods connect), MicGuard immediately reverts to your preferred microphone.
On first launch the current input device becomes your preferred mic. Enable launch at login with the toggle in MicGuard's Settings (or under System Settings > General > Login Items & Extensions - both control the same macOS-managed state). To disable MicGuard, quit the app.
Everything is configured in the Settings window, opened from the menu bar icon. The icon itself can be hidden there; reopening the app (Finder double-click, open -a MicGuard) always shows Settings, so that is the way back in when the icon is hidden.
- Menubar app - runs silently in the background with a shield+mic icon (hideable in Settings)
- Auto-revert - reverts unwanted input device switches caused by Bluetooth connections
- Self-contained - no config files, no CLI; settings live in macOS defaults
MicGuard has two device enforcement modes, switchable in Settings:
Protects your preferred mic during device connect/disconnect events. If you switch the input device in System Settings after devices have settled, MicGuard recognizes this as intentional and saves the new choice as your preferred mic.
Always reverts to your chosen preferred device, no matter when or why the switch happened. Turn off Auto Mode in Settings to pick a device.
All settings live in macOS defaults under the cz.szypowi.micguard domain:
| Key | Purpose |
|---|---|
preferredDevice |
Exact name of your preferred input device |
mode |
auto or manual - device enforcement strategy (default: auto) |
settleSeconds |
Seconds to wait before accepting a device switch as user-initiated (1-30, default: 2) |
showMenuBarIcon |
Show the menu bar icon (default: true); changes apply live |
defaults read cz.szypowi.micguard # inspect
defaults write cz.szypowi.micguard settleSeconds -float 5 # tune settle period (no UI)
defaults delete cz.szypowi.micguard # reset everythingFor personal integrations (e.g. SketchyBar), MicGuard posts read-only telemetry. There is no way to control or query MicGuard externally - it only tells:
cz.szypowi.micguard.statusChanged- distributed notification posted on startup and whenever the current input device or its muted state changes; userInfo:device(name),muted("true"/"false"- volume 0 or hardware mute flag)
MicGuard logs to the unified logging system with subsystem cz.szypowi.micguard:
log stream --predicate 'subsystem == "cz.szypowi.micguard"' --level debug # follow live
log show --predicate 'subsystem == "cz.szypowi.micguard"' --last 1h --info --debug # past logsIn fish, log is a builtin - use /usr/bin/log.
Notes:
- When a Bluetooth device connects or disconnects, CoreAudio fires
DEVICE_LIST_CHANGEDandDEFAULT_INPUT_CHANGEDtwo or three times per event. Duplicate log lines are normal macOS behavior; the handlers are idempotent. - Running the raw binary (
/Applications/MicGuard.app/Contents/MacOS/MicGuard) bypasses theLSMultipleInstancesProhibitedduplicate-instance check - quit the running instance first. Logs go to the unified log, not stderr. - Development loop:
make devbuilds the bundle and (re)launches it,make dev-stopkills it.
Common issues:
- Preferred mic not found - if the preferred device is disconnected, MicGuard keeps monitoring and switches back when it reconnects.
- Login item not starting - check System Settings → General → Login Items; re-toggle "Launch at Login" in MicGuard's Settings.
- Reset -
defaults delete cz.szypowi.micguard, then relaunch; the current input device becomes the preferred mic again.
MIT