# 使用 Homebrew 安装 xcenv

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

## 安装

```sh
sudo av install brew:xcenv
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install xcenv
```

  证据: local Homebrew formula metadata

## 软件包事实

- **软件包键:** brew:xcenv
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/xcenv>
- **版本:** 1.2.0
- **来源摘要:** Xcode version manager
- **主页:** <https://github.com/xcenv/xcenv>
- **仓库:** <https://github.com/xcenv/xcenv>
- **许可证:** MIT
- **源码归档:** <https://github.com/xcenv/xcenv/archive/refs/tags/v1.2.0.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- xcenv (cli)
- xcenv (别名)

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 all

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 1.2.0
- 本地数据: OK
- 上游仓库: https://github.com/xcenv/xcenv
- 检测到的最新版本: v1.2.0 (当前)
- 信息: No package-manager update timestamp was available.
## 项目历史与用法

xcenv is an Xcode version manager modeled around project and global version files. Its README frames the tool as a way to document and manage the Xcode version required by a project or shell environment.

### 项目历史

xcenv was created to solve a common Apple-development problem: teams often need multiple Xcode.app bundles installed, but `xcode-select` and `DEVELOPER_DIR` require agreement on exact application paths. The README explicitly calls out conflicting app naming conventions, such as `Xcode7.2.app` versus `Xcode_7_2.app`, as the kind of team-level friction the tool avoids.

### 采用历史

The tool follows the family pattern of language and runtime managers that use shims plus local and global version files. In xcenv's case, those shims wrap tools such as `xcodebuild`, `xcrun`, and other Xcode binaries so third-party build tools can inherit the selected Xcode version.

### 使用方式

xcenv chooses the active Xcode version from `DEVELOPER_DIR`, then `XCENV_VERSION`, then the nearest `.xcode-version` file, then the global `~/.xcenv/.xcode-version` file. A project can commit `.xcode-version` so that switching branches or checking out old commits also records the expected Xcode toolchain.

The main commands are `xcenv local`, `xcenv global`, `xcenv shell`, `xcenv version`, and `xcenv rehash`. Its README names Fastlane, CocoaPods, Shenzhen, and existing scripts using `xcodebuild` or `xcrun` as examples of tools that can benefit from the shim approach.

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

xcenv is notable less as a large project than as an Apple-platform adaptation of the version-file convention familiar from tools such as rbenv. For package and build-system users, the important idea is that the required Xcode version can live with the source tree instead of in local machine notes.

### 时间线

- 2010s: xcenv adopts a shim-and-version-file model for Xcode toolchains.
- 2020s: The `.xcode-version` convention remains visible in Apple build tooling discussions and related tools.

### Related projects

- The README names Fastlane, CocoaPods, and Shenzhen as tools that can run through xcenv shims.
- Later Xcode managers such as Xcodes and Xcodes.app focus more on downloading and switching installed Xcode versions, while xcenv centers on documenting and resolving the version to use.

### 来源

- <https://github.com/XcodesOrg/XcodesApp#readme>
- <https://github.com/XcodesOrg/xcodes#readme>
- <https://github.com/xcenv/xcenv#readme>


## 安全说明

infrastructure mutation or orchestration signal.

- **Geiger 风险:** orange / 中
- infrastructure mutation or orchestration signal


## 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: ./.xcode-version, ~/.xcenv/.xcode-version
## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** xcenv
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Requirements:** macos
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [xcodes](https://pkg.so/zh-hans/brew/xcodes/) - Shares pkgdb curated category or tags: apple-development, cli, developer-tools, version-manager, xcode.
- [jenv](https://pkg.so/zh-hans/brew/jenv/) - Shares pkgdb curated category or tags: cli, developer-tools, environment-manager, version-manager.
- [scalaenv](https://pkg.so/zh-hans/brew/scalaenv/) - Shares pkgdb curated category or tags: cli, developer-tools, environment-manager, version-manager.
- [xcbeautify](https://pkg.so/zh-hans/brew/xcbeautify/) - Shares pkgdb curated category or tags: cli, developer-tools, xcode.
- [cocoapods](https://pkg.so/zh-hans/brew/cocoapods/) - Shares pkgdb curated category or tags: cli, developer-tools, xcode.
- [xcodegen](https://pkg.so/zh-hans/brew/xcodegen/) - Shares pkgdb curated category or tags: cli, developer-tools, xcode.
- [xclogparser](https://pkg.so/zh-hans/brew/xclogparser/) - Shares pkgdb curated category or tags: cli, developer-tools, xcode.
- [rbenv](https://pkg.so/zh-hans/brew/rbenv/) - Shares pkgdb curated category or tags: cli, developer-tools, version-manager.

## Combined YAML source

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


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- cross-ecosystem install command graph
