# macOS (Apple Silicon): zsh: bad CPU type in executable: ./tool

**Code:** `zsh: bad CPU type in executable` · **Category:** macOS · **Seen on:** macOS

You ran an Intel (x86_64) program on an Apple Silicon Mac without Rosetta 2 (or an arm64 binary on an Intel Mac).

## Meaning

Install Rosetta with `softwareupdate --install-rosetta --agree-to-license` or get an arm64 build of the tool. Check the binary with `file ./tool` / `lipo -info`. Docker images may need `--platform linux/amd64`.

## Common causes

- Rosetta 2 not installed
- x86_64-only binary
- Running an arm64 build on an Intel Mac
- Homebrew installed under Rosetta (/usr/local) on an M-series Mac
- Old toolchain without arm64 support

## Quick fix

1. `softwareupdate --install-rosetta --agree-to-license`
2. Download the arm64/universal build
3. `arch -x86_64 ./tool` after Rosetta is installed

## Detailed fix by platform

### macOS

1. `file ./tool` and `uname -m` (arm64 vs x86_64)

## How to diagnose

1. **Binary** — file output?
2. **CPU** — uname -m?
3. **Rosetta** — Installed?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/macos/bad-cpu-type-in-executable)
