Emulation

Portal 2 runs natively on Mac and iPhone, no emulator

By Tgames · · 2 min read

Portal 2 runs natively on Apple Silicon Macs and on iPhone, at 60 fps, thanks to a recompilation of the game's Linux version, with no emulator or Wine.


The Linux version, translated for ARM

portal2-recomp, by Raphaël Kanapitsas (GPL-3.0 license), translates the x86 code of Portal 2's Linux executables into C, then compiles it for Apple's ARM64 processors: no emulator, no Wine, no Rosetta. A small environment provides what the Linux executables expect (system libraries, SDL2, graphics, Steam). Rendering goes through Metal, about 50% faster on Mac than the fallback OpenGL. The repository opened on 27 October.


The results
  • Mac: fully playable, at 235 to 280 fps on an M3 Pro chip.
  • iPhone: fully playable at a stable 60 fps on an iPhone 15 Pro Max, the only one tested, with touch controls. Tapping the back of the phone fires portals.
  • The local network co-op: one Mac hosts, another Mac or an iPhone joins the game.
On iPhone, there are no Steam features (achievements, invites, cloud saves).


Build it yourself

There is no ready-made build: the setup.sh script builds the game on your Mac, in about ten minutes the first time. You need an Apple Silicon Mac with Python 3, Homebrew and the Xcode command line tools, plus Rust for the Metal renderer. Above all, you need your own copy of Portal 2 on Steam, plus the Linux executables, retrieved with the download_depot 620 661 command in the Steam console (about 90 MB). For the iPhone, Xcode installs and signs the app with your Apple ID; a free account means redoing it every 7 days, and you need about 12 GB free on the phone. The author points out that the generated app contains Valve's game: keep it to yourself.


Written with AI

The repository states that most of the code was written by AI agents (Claude Code and Codex) under the author's direction, and that the full history is public. After Half-Life 2 on PS Vita, it's another Valve game gaining a new platform.


Sources: portal2-recomp (GitHub) · iPhone video (YouTube)

No comments