Skip to content

ColdSlither/codex-intel-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codex Intel Builder

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.


Prerequisites

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)

Usage

1. Run preflight checks

./checks.sh

To auto-install missing npm tools:

./checks.sh --fix

2. Build

./build-codex-intel.sh /path/to/Codex.dmg

That's it. The script runs the full pipeline and produces CodexAppMacIntel.dmg in the project directory.

3. Install and launch

# 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

What the script does

  1. Preflight — verifies all dependencies are present
  2. Mount DMG read-only — attaches the input DMG without browsing
  3. Copy app — copies Codex.app to a local work directory
  4. Detect Electron version — reads from the app's own framework metadata (does not guess from npm)
  5. Extract native module versions — reads better-sqlite3 and node-pty versions from the app's bundled package.json
  6. Rebuild native modules — installs and rebuilds the native modules for x64 using @electron/rebuild
  7. Replace .node artifacts — swaps arm64 .node files in app.asar.unpacked with the freshly built x64 versions
  8. Replace binaries — replaces arm64 rg (ripgrep) with the pinned x64 GitHub release; attempts to replace the codex CLI binary via the @openai/codex npm package
  9. Handle Sparkle — disables the arm64-only Sparkle auto-update addon (see Known Limitations)
  10. Repack asar — repacks the modified app content into app.asar
  11. Validate — runs file on all replaced .node files and binaries; fails if any are not x86_64
  12. Codesign — applies ad-hoc signing (codesign --force --deep --sign -)
  13. Package DMG — creates CodexAppMacIntel.dmg
  14. SHA256 — prints the checksum of the output DMG

Known Limitations

Bootstrapping

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.

Gatekeeper / Ad-hoc signing only

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.app

This 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.

Auto-updates disabled

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.

codex CLI binary

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.

Not affiliated with OpenAI or Anthropic

This is a community build tool. It does not modify the app's logic, only its native binary dependencies. Use at your own risk.


Troubleshooting

"Preflight checks failed"

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.

"Could not detect Electron version"

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.

"N binary/binaries failed x86_64 validation"

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.

App crashes on launch

Capture logs:

log show --predicate 'process == "Codex"' --last 5m > crash-log.txt

Common causes:

  • A native .node module was not replaced (look for DYLD or Mach-O errors in crash-log.txt)
  • The codex CLI binary is still arm64 (check file /Applications/Codex.app/Contents/Resources/codex)
  • Quarantine was not removed (xattr -cr /Applications/Codex.app)

"hdiutil: attach failed"

The input DMG may be corrupted or password-protected. Verify you can mount it manually: hdiutil attach /path/to/Codex.dmg

npm install fails

Ensure you are on Node v16 or later (node --version). If behind a proxy, set HTTP_PROXY and HTTPS_PROXY environment variables.

About

Convert ARM Codex macOS DMG to Intel (x86_64) — run OpenAI Codex on older Intel Macs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors