# 使用 Homebrew, MacPorts, Nix 安装 switchaudio-osx

查看 switchaudio-osx 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:switchaudio-osx
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install switchaudio-osx
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install switchaudio-osx
```

  证据: MacPorts ports tree: audio/switchaudio-osx/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#switchaudio-osx
```

  证据: nixpkgs package indexes: pkgs/by-name/sw/switchaudio-osx/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:switchaudio-osx
- **软件包管理器:** Homebrew
- **版本:** 1.2.2
- **来源摘要:** Change macOS audio source from the command-line
- **主页:** <https://github.com/deweller/switchaudio-osx/>
- **仓库:** <https://github.com/deweller/switchaudio-osx>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- SwitchAudioSource (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.2.2
## 项目历史与用法

SwitchAudioSource is a macOS command-line utility for switching the system audio source without opening the graphical sound settings. Its appeal is narrow but durable: shell users, automation users, and hotkey-tool users can script audio input, output, system device, mute, and cycling behavior.

### 项目历史

The upstream README describes a command-line-only utility for Mac OS X, tested across OS X 10.7 through macOS 11.2. The license and README credit Devon Weller beginning in 2008 and Christian Zuckschwerdt for migrating the project to GitHub and adding the next-device option.

### 采用历史

The README explicitly documents Homebrew installation, and the input package facts show the same utility distributed through Homebrew, MacPorts, and Nix. That spread is typical for small macOS-native command-line tools that remain useful because they wrap a missing shell affordance.

### 使用方式

Users run SwitchAudioSource to list devices, print the current device, set a device by name, id, or uid, choose input/output/system device type, select human/CLI/JSON output, or toggle mute status for input or output devices. The README gives microphone muting as a hotkey-oriented use case.

### 为什么软件包爱好者会关心

Package nerds care because this is exactly the kind of tiny Mac utility package managers preserve: a single-purpose CLI that exposes system behavior to scripts, dotfiles, launchers, and keyboard automation.

### 时间线

- 2008: Copyright attribution begins for Devon Weller in the upstream license/README.
- 2011: Copyright attribution begins for Christian Zuckschwerdt in the upstream README.
- Homebrew era: The README documents brew install switchaudio-osx.
- macOS 11.2 era: The README states the utility was tested through OS 11.2.

### Related projects

- The project is related to macOS automation, hotkey managers, and dotfile scripts that need to select audio devices without GUI interaction.

### 来源

- <https://github.com/deweller/switchaudio-osx>
- <https://github.com/deweller/switchaudio-osx#readme>
- source_facts.executables
- source_facts.package-manager


## 安全说明

broad file, network, media, or database tool signal.

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal

## 其他软件包管理器记录

- Nix - switchaudio-osx: normalized package name match | nixpkgs package indexes: pkgs/by-name/sw/switchaudio-osx/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - switchaudio-osx: normalized package name match | MacPorts ports tree: audio/switchaudio-osx/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/switchaudio-osx.yml](https://github.com/mxcl/pkgdb/blob/main/combined/switchaudio-osx.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
