Prevents Bluetooth audio devices (e.g. AirPods) from hijacking the default macOS microphone.
- macOS 15+ on Apple Silicon
brew install pszypowicz/tap/micguardRelease builds are signed with a Developer ID certificate and notarized, so Gatekeeper accepts them as-is.
Release candidates ship as GitHub pre-releases and through the micguard@beta cask, which replaces micguard while installed. The tap README covers switching between the two and moving over from the old mic-guard cask.
Grab MicGuard.dmg from the latest release, open it, and drag MicGuard into Applications.
make installBuilding needs Xcode 27 or later. This builds an ad hoc signed copy. To sign with one of your own certificates instead, pass part of its name, for example make install IDENTITY="Apple Development".
MicGuard 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
- Languages - English and Polish, following the language order in System Settings
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, applies live)
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, empty when there is no input device),muted("true"/"false"- volume 0 or hardware mute flag)
MicGuard follows semantic versioning. Within 1.x, these stay compatible:
- The
cz.szypowi.micguarddefaults domain, with the keys and values listed under Configuration. - The
cz.szypowi.micguard.statusChangednotification and its userInfo, as described under Status broadcast.
A change that breaks either of them ships as 2.0. Log messages can change in any release.
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