Skip to content

Instantly share code, notes, and snippets.

@4np
Last active June 28, 2026 10:35
Show Gist options
  • Select an option

  • Save 4np/163bdca5cffe08b245a5dfd4060e75a1 to your computer and use it in GitHub Desktop.

Select an option

Save 4np/163bdca5cffe08b245a5dfd4060e75a1 to your computer and use it in GitHub Desktop.
Install Steam on macOS without installing Rosetta 2
#!/bin/bash
#
# The Steam Installer requires Rosetta 2, while the Steam app itself is a universal binary.
# This script will download Steam from Valve's CDN and install it directly, bypassing the
# installer's Rosetta 2 requirement.
#
# This script is an adaptation of https://github.com/i1rr/steam-arm64-mac, and differs in
# several security-focused ways:
# 1) Verifies authenticity before installation. It validates the downloaded Steam.app's
# Apple code signature and confirms the Valve Team ID (MXGJJ98X76) before copying
# anything into /Applications. The original installed first and verified afterwards.
# 2) Fails securely. If any verification step fails (download, extraction, signature,
# Team ID, ARM64 check), the script immediately aborts without modifying your system.
# 3) Preserves macOS security. It does not remove the com.apple.quarantine attribute.
# This keeps Gatekeeper's normal protection and first-launch verification intact.
# 4) Backs up instead of deleting. Rather than running rm -rf /Applications/Steam.app,
# it renames any existing installation to a timestamped backup, allowing easy recovery.
# 5) Uses stricter shell settings. It enables set -euo pipefail, uses safer quoting
# throughout, and cleans up temporary files automatically, reducing the risk of
# unexpected behavior.
# 6) Validates downloaded content. It performs basic sanity checks on the filename
# obtained from Valve's manifest before downloading and extracting it.
# 7) Checks prerequisites up front. It verifies that required tools (curl, unzip,
# tar, codesign, lipo) are present and that Steam is not currently running
# before making any changes.
# 8) Avoids partially installed states. The original script could leave an untrusted
# Steam.app in /Applications if verification failed. The rewritten version only
# installs after all checks have succeeded.
set -euo pipefail
IFS=$'\n\t'
VALVE_TEAM_ID="MXGJJ98X76"
CDN_BASE="https://client-update.steamstatic.com"
APP_DEST="/Applications/Steam.app"
fail() {
echo "Error: $*" >&2
exit 1
}
cleanup() {
[[ -n "${TMP_DIR:-}" && -d "$TMP_DIR" ]] && rm -rf "$TMP_DIR"
}
trap cleanup EXIT
echo "Steam ARM64 installer for Apple Silicon Macs"
echo "==========================================="
[[ "$(uname -m)" == "arm64" ]] || fail "This script is for Apple Silicon Macs only."
command -v curl >/dev/null || fail "curl not found."
command -v unzip >/dev/null || fail "unzip not found."
command -v tar >/dev/null || fail "tar not found."
command -v codesign >/dev/null || fail "codesign not found."
command -v lipo >/dev/null || fail "lipo not found."
if pgrep -x "steam_osx" >/dev/null || pgrep -x "Steam" >/dev/null; then
fail "Steam is running. Quit Steam fully and try again."
fi
TMP_DIR="$(mktemp -d)"
MANIFEST_FILE="$TMP_DIR/manifest.txt"
ZIP_FILE="$TMP_DIR/appdmg_osx.zip"
echo "Fetching Valve manifest..."
curl --fail --silent --show-error --location \
--proto '=https' \
--tlsv1.2 \
"$CDN_BASE/steam_client_osx" \
--output "$MANIFEST_FILE"
FILE="$(
grep -A20 '"appdmg_osx"' "$MANIFEST_FILE" |
grep -v steamchina |
grep '"file"' |
awk -F'"' '{print $4}' |
head -n 1
)"
[[ -n "$FILE" ]] || fail "Could not parse package filename."
[[ "$FILE" != /* && "$FILE" != *".."* ]] || fail "Suspicious filename in manifest: $FILE"
echo "Downloading: $FILE"
curl --fail --silent --show-error --location \
--proto '=https' \
--tlsv1.2 \
"$CDN_BASE/$FILE" \
--output "$ZIP_FILE"
echo "Extracting package..."
unzip -q "$ZIP_FILE" -d "$TMP_DIR"
BOOTSTRAP_TAR="$TMP_DIR/SteamMacBootstrapper.tar.gz"
[[ -f "$BOOTSTRAP_TAR" ]] || fail "Expected SteamMacBootstrapper.tar.gz not found."
tar -xzf "$BOOTSTRAP_TAR" -C "$TMP_DIR"
STAGED_APP="$TMP_DIR/Steam.app"
STEAM_BIN="$STAGED_APP/Contents/MacOS/steam_osx"
[[ -d "$STAGED_APP" ]] || fail "Steam.app not found after extraction."
[[ -f "$STEAM_BIN" ]] || fail "Steam executable not found."
echo "Checking Apple Silicon support..."
lipo -archs "$STEAM_BIN" | grep -qw "arm64" || fail "Steam binary does not contain arm64."
echo "Verifying Valve code signature..."
codesign --verify --deep --strict --verbose=2 "$STAGED_APP" >/dev/null
TEAM_ID="$(
codesign -dv "$STAGED_APP" 2>&1 |
awk -F= '/TeamIdentifier/ { print $2; exit }'
)"
[[ "$TEAM_ID" == "$VALVE_TEAM_ID" ]] || fail "Unexpected Team ID: ${TEAM_ID:-none}"
echo "Valve signature verified: $TEAM_ID"
if [[ -d "$APP_DEST" ]]; then
BACKUP="/Applications/Steam.app.backup.$(date +%Y%m%d-%H%M%S)"
echo "Backing up existing Steam.app to:"
echo "$BACKUP"
mv "$APP_DEST" "$BACKUP"
fi
echo "Installing Steam..."
cp -R "$STAGED_APP" /Applications/
echo "Configuring Steam public beta channel..."
STEAM_PKG_DIR="$HOME/Library/Application Support/Steam/package"
mkdir -p "$STEAM_PKG_DIR"
printf '%s\n' "publicbeta" > "$STEAM_PKG_DIR/beta"
echo "Done."
echo "Steam installed at /Applications/Steam.app"
echo "Launch it from Finder or Spotlight."
@4np

4np commented Jun 28, 2026

Copy link
Copy Markdown
Author

Example:

./steam.sh
Steam ARM64 installer for Apple Silicon Macs
===========================================
Fetching Valve manifest...
Downloading: appdmg_osx.zip.984652b88a9737e3f4e77c656d9ffa67d5042c2c
Extracting package...
Checking Apple Silicon support...
Verifying Valve code signature...
--prepared:/private/var/folders/dh/_ht1j9k13b32rj0nwx_85vph0000gn/T/tmp.10kZVbyBay/Steam.app/Contents/Frameworks/crashhandler.dylib
--validated:/private/var/folders/dh/_ht1j9k13b32rj0nwx_85vph0000gn/T/tmp.10kZVbyBay/Steam.app/Contents/Frameworks/crashhandler.dylib
--prepared:/private/var/folders/dh/_ht1j9k13b32rj0nwx_85vph0000gn/T/tmp.10kZVbyBay/Steam.app/Contents/Frameworks/Breakpad.framework/Versions/Current/.
--validated:/private/var/folders/dh/_ht1j9k13b32rj0nwx_85vph0000gn/T/tmp.10kZVbyBay/Steam.app/Contents/Frameworks/Breakpad.framework/Versions/Current/.
/var/folders/dh/_ht1j9k13b32rj0nwx_85vph0000gn/T/tmp.10kZVbyBay/Steam.app: valid on disk
/var/folders/dh/_ht1j9k13b32rj0nwx_85vph0000gn/T/tmp.10kZVbyBay/Steam.app: satisfies its Designated Requirement
Valve signature verified: MXGJJ98X76
Installing Steam...
Configuring Steam public beta channel...
Done.
Steam installed at /Applications/Steam.app
Launch it from Finder or Spotlight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment