xcode-arch

A utility to switch running architecture of Xcode on M1 mac.

Motivation

Currently, there is no way to toggle Open using Rosetta option other than in Finder.

off on
Rosetta off Rosetta on

This provides a command-line tool to set on/off or toggle Open using Rosetta option.

Installation

Homebrew(recommended)

brew install 417-72KI/tap/xcode-arch

Mint

mint install 417-72KI/[email protected]

Usage

$ xcode-arch -p
arm64 # `Open using Rosetta` is off
$ xcode-arch -c
Set x86_64 for /Applications/Xcode.app
$ xcode-arch -p
x86_64 # `Open using Rosetta` is on
$ xcode-arch -u
Set arm64 for /Applications/Xcode.app
$ xcode-arch -p
arm64 # `Open using Rosetta` is off

You can switch / print with specific Xcode path by using DEVELOPER_DIR.

$ DEVELOPER_DIR=/Applications/Xcode-13.2.1.app xcode-arch -c
`/Applications/Xcode-13.2.1.app` is running with x86_64

Requirements

  • macOS 12.0+
  • Xcode 13.3+ (Swift 5.6+)

GitHub

View Github