Build C++ Apps and Games entirely from your iPhone using GitHub Codespaces.
| File | Purpose |
|---|---|
.devcontainer/devcontainer.json |
Auto-installs Emscripten + SDL2 in Codespaces |
main.cpp |
Your app logic (game loop with a bouncing red box demo) |
Makefile |
Compiles C++ to WebAssembly (generates index.html) |
- Create a new Public GitHub repo (e.g.,
ios-cpp-master) - keep it empty - Tap Code > Codespaces > Create codespace on main
- Upload/copy these files into the codespace
# 1. Compile
make
# 2. Launch local server
python3 -m http.server 8080- Tap "Open in Browser" when the popup appears
- Your app runs in Safari - tap the screen to reverse the red box
Copy main.cpp and Makefile to a new folder. The .devcontainer keeps your environment ready.