# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper, scoop 安装 open-ocd

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

## 安装

```sh
sudo av install brew:open-ocd
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install open-ocd
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install openocd
```

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

### Linux

- apk (92%):

```sh
sudo apk add openocd
```

  证据: Alpine Linux edge package indexes: openocd from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install openocd
```

  证据: Debian stable package indexes: openocd from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install openocd
```

  证据: Fedora Rawhide package metadata: openocd from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#openocd
```

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

- pacman (92%):

```sh
sudo pacman -S openocd
```

  证据: Arch Linux sync databases: openocd from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install openocd
```

  证据: openSUSE Tumbleweed package metadata: openocd from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Scoop (92%):

```sh
scoop install main/openocd
```

  证据: Scoop official bucket manifest trees: bucket/openocd.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:open-ocd
- **软件包管理器:** Homebrew
- **版本:** 0.12.0
- **来源摘要:** On-chip debugging, in-system programming and boundary-scan testing
- **主页:** <https://openocd.org/>
- **仓库:** <https://github.com/openocd-org/openocd>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- openocd (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

OpenOCD, the Open On-Chip Debugger, is a command-line server and toolset for embedded debugging, in-system flash programming, and boundary-scan work. It sits between host debuggers such as GDB and hardware debug adapters that speak transports such as JTAG or SWD.

### 项目历史

OpenOCD was created by Dominic Rath as part of a 2005 diploma thesis at the University of Applied Sciences Augsburg. Its documentation describes the project as having grown from that thesis into an open-source project supported by software and hardware developers around the world.

The project's scope expanded from JTAG-centered on-chip debugging into a practical embedded bring-up tool: it handles debug adapters, target configuration scripts, CPU cores, flash chips, FPGA/PLD loading paths, and server interfaces for GDB, Telnet, and RPC clients.

### 采用历史

OpenOCD became a common tool in embedded development because it gives open tooling a shared place to encode adapter and board knowledge. The user guide documents bundled script libraries for interfaces, boards, targets, and site-specific configuration, which is why many vendor and community board workflows invoke openocd with one or two -f script arguments.

Distribution packaging spread it broadly across embedded Linux and desktop development environments. Homebrew, Debian, Fedora, Arch, Nix, Scoop, and other package managers expose the same openocd executable, making it a portable default for projects that want to document one debugger command.

### 使用方式

A typical OpenOCD session names an adapter script and a board or target script, starts the OpenOCD server, waits for a JTAG or SWD target to be detected, and then connects GDB to the server for breakpoints, stepping, register access, and memory inspection.

For production and lab work, OpenOCD is also used for flash programming and boundary-scan tasks. The documentation covers NOR and NAND flash support, PLD/FPGA loading commands, and SVF/XSVF execution for JTAG test patterns.

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

OpenOCD is package-nerd significant because its executable is only half the package. The script library, USB permissions, adapter driver choices, Tcl integration, and packaged target definitions are what turn the binary into a usable hardware tool.

It also shows why embedded packages are unusually sensitive to version and build options: support for a specific probe, chip, flash driver, or board script can decide whether a firmware workflow works at all.

### 时间线

- 2005: Dominic Rath created OpenOCD as part of a diploma thesis at the University of Applied Sciences Augsburg.
- 2008-2025: the user guide credits the OpenOCD Project across this span, with earlier named contributors credited for 2007-2010 documentation work.
- 2026-06-29: the OpenOCD user guide snapshot used for this enrichment documents release 0.12.0+dev.

### Related projects

- GDB is the debugger most commonly paired with OpenOCD for source-level debugging.
- JTAG, SWD, SVF, XSVF, and IEEE 1149.1 are the hardware and test-procedure ecosystems that explain much of OpenOCD's command surface.

### 来源

- <https://formulae.brew.sh/formula/open-ocd>
- <https://github.com/openocd-org/openocd>
- <https://openocd.org/doc/html/About.html>
- <https://openocd.org/doc/html/Boundary-Scan-Commands.html>
- <https://openocd.org/doc/html/PLD_002fFPGA-Commands.html>
- <https://openocd.org/doc/html/Running.html>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: openocd.cfg, $(INSTALLDIR)/scripts
## 其他软件包管理器记录

- MacPorts - openocd: installed executable or alias match | MacPorts ports tree: cross/openocd/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Debian apt - openocd - 0.12.0-3+b2: installed executable or alias match | Debian stable package indexes: openocd from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Open on-chip JTAG/SWD debug solution for embedded target devices | http://openocd.sourceforge.net/
- Nix - openocd: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/op/openocd/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - openocd - 0.12.0-1build2: installed executable or alias match | Ubuntu 24.04 LTS package indexes: openocd from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Open on-chip JTAG/SWD debug solution for embedded target devices | http://openocd.sourceforge.net/
- apk - openocd - 0.12.0-r7: installed executable or alias match | Alpine Linux edge package indexes: openocd from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing | https://openocd.org/
- apk - openocd-dev - 0.12.0-r7: installed executable or alias match | Alpine Linux edge package indexes: openocd-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing (development files) | https://openocd.org/
- apk - openocd-doc - 0.12.0-r7: installed executable or alias match | Alpine Linux edge package indexes: openocd-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing (documentation) | https://openocd.org/
- apk - openocd-udev - 0.12.0-r7: installed executable or alias match | Alpine Linux edge package indexes: openocd-udev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | udev rules for openocd | https://openocd.org/
- dnf - openocd - 0.12.0-4.gitcb52502.fc45.2: installed executable or alias match | Fedora Rawhide package metadata: openocd from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Debugging, in-system programming and boundary-scan testing for embedded devices | https://sourceforge.net/projects/openocd
- pacman - openocd - 1:0.12.0-5: installed executable or alias match | Arch Linux sync databases: openocd from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Debugging, in-system programming and boundary-scan testing for embedded target devices | https://openocd.org
- zypper - openocd - 0.12.0-2.13: installed executable or alias match | openSUSE Tumbleweed package metadata: openocd from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Debugging, in-system programming and boundary-scan testing for embedded devices | http://openocd.sourceforge.net/
- zypper - openocd-data - 0.12.0-2.13: installed executable or alias match | openSUSE Tumbleweed package metadata: openocd-data from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Hardware Scripts for OpenOCD | http://openocd.sourceforge.net/
- Scoop - main/openocd: installed executable or alias match | Scoop official bucket manifest trees: bucket/openocd.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Combined YAML source

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


## 来源

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