Build target-specific binaries for packaging instead of running them locally.

Section: Targets and cross-compilation

Run is typically host-only

bash
bash
cargo build --target aarch64-apple-darwin
Explanation

Cross-target binaries usually cannot be executed directly on the host unless compatible.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Targets and cross-compilation
Build for a target triple
Compile artifacts for a non-default platform.
OpenIn sheetbashsame section
List available targets
Show supported target triples.
OpenIn sheetbashsame section
Add a Linux musl target
Install standard libraries for a cross target.
OpenIn sheetbashsame section
Add Apple Silicon target
Install support for macOS ARM builds.
OpenIn sheetbashsame section
Use stable once without changing defaults
Run one command on the stable toolchain.
OpenIn sheetbash1 tag match
List installed toolchains
Display toolchains available on the machine.