Converts an official ARM (Apple Silicon) Codex macOS DMG into an Intel (x86_64) compatible app DMG. Designed for 2018 Intel MacBook Pro running macOS.
| Dependency | How to get it |
|---|---|
| macOS on Intel (x86_64) | Required — this tool is not for Apple Silicon |
| Homebrew | https://brew.sh |
| Node.js (v16+) | brew install node |
| npm | Ships with Node |
| Xcode CLI Tools | Auto-prompted by checks.sh --fix, or run xcode-select --install |
codesign, hdiutil, file, shasum |
Ship with macOS (require Xcode CLI Tools) |
./checks.shTo auto-install missing npm tools:
./checks.sh --fix./build-codex-intel.sh /path/to/Codex.dmgThat's it. The script runs the full pipeline and produces CodexAppMacIntel.dmg in the project directory.
# Mount the output DMG
hdiutil attach CodexAppMacIntel.dmg
# Copy to Applications
cp -R /Volumes/CodexAppMacIntel/Codex.app /Applications/
# Remove quarantine (required — see note below)
xattr -cr /Applications/Codex.app
# Launch
open /Applications/Codex.app- Preflight — verifies all dependencies are present
- Mount DMG read-only — attaches the input DMG without browsing
- Copy app — copies
Codex.appto a local work directory - Detect Electron version — reads from the app's own framework metadata (does not guess from npm)
- Extract native module versions — reads
better-sqlite3andnode-ptyversions from the app's bundledpackage.json - Rebuild native modules — installs and rebuilds the native modules for x64 using
@electron/rebuild - Replace .node artifacts — swaps arm64
.nodefiles inapp.asar.unpackedwith the freshly built x64 versions - Replace binaries — replaces arm64
rg(ripgrep) with the pinned x64 GitHub release; attempts to replace thecodexCLI binary via the@openai/codexnpm package - Handle Sparkle — disables the arm64-only Sparkle auto-update addon (see Known Limitations)
- Repack asar — repacks the modified app content into
app.asar - Validate — runs
fileon all replaced.nodefiles and binaries; fails if any are not x86_64 - Codesign — applies ad-hoc signing (
codesign --force --deep --sign -) - Package DMG — creates
CodexAppMacIntel.dmg - SHA256 — prints the checksum of the output DMG
Node.js and Homebrew must already be installed. The script will fail fast with a clear message if they are missing. Xcode CLI Tools can be auto-installed via ./checks.sh --fix.
The output app is signed with an ad-hoc identity (-), not a Developer ID certificate. macOS Gatekeeper will flag it as untrusted. You must run the following after installing:
xattr -cr /Applications/Codex.appThis removes the quarantine attribute so the app can open. You may also see a security warning the first time you launch — click "Open Anyway" in System Preferences > Security & Privacy.
The Sparkle auto-update native addon is arm64-only and cannot be trivially rebuilt. The build script disables it by patching the require site in the app bundle. The app will not attempt to auto-update. To get a newer version of Codex, re-run this script with a newer ARM DMG.
The bundled codex CLI binary replacement is attempted via the @openai/codex npm package. If that package does not distribute a pre-built x86_64 binary (e.g., if it only ships for the current platform), the build will fail with a clear message indicating manual intervention is needed. In that case, you would need to obtain or cross-compile an x86_64 codex binary and place it at the path indicated in the error.
This is a community build tool. It does not modify the app's logic, only its native binary dependencies. Use at your own risk.
Run ./checks.sh and read the [FAIL] lines. Run ./checks.sh --fix to auto-install npm tools. For Xcode CLI Tools, a GUI prompt will appear.
The script tries four detection strategies. If all fail, the app bundle may have an unusual structure. Open Codex.app/Contents/Frameworks/Electron Framework.framework/Resources/Info.plist and look for CFBundleShortVersionString — then set ELECTRON_VERSION manually at the top of build-codex-intel.sh.
A replaced binary is still arm64. Check the log for which file failed. The most likely cause is that the @electron/rebuild step targeted the wrong ABI. Check ELECTRON_VERSION and re-run.
Capture logs:
log show --predicate 'process == "Codex"' --last 5m > crash-log.txtCommon causes:
- A native
.nodemodule was not replaced (look forDYLDorMach-Oerrors in crash-log.txt) - The
codexCLI binary is still arm64 (checkfile /Applications/Codex.app/Contents/Resources/codex) - Quarantine was not removed (
xattr -cr /Applications/Codex.app)
The input DMG may be corrupted or password-protected. Verify you can mount it manually: hdiutil attach /path/to/Codex.dmg
Ensure you are on Node v16 or later (node --version). If behind a proxy, set HTTP_PROXY and HTTPS_PROXY environment variables.