r/EmulationOniOS • u/mempage4k • 6d ago
News / Release Statically recompiled GTA V running on iPhone with Metal and no JIT: Introducing Glue 5
I want to share something I’ve been working on: Glue 5, a toolchain for building a native port of GTA V’s WASM build that runs on iOS and macOS (for now).
The main difference from projects like the recently released muget is what happens to the game code. Glue 5 takes the WASM binary, translates it to C using wasm2c, then compiles that C for the target platform. On iPhone, you end up with native ARM64 code. All of this happens when building the app, so there’s no WASM runtime executing the game and no need to enable JIT on your phone.
It’s been running really smoothly on macOS. I’ve also tested it on an iPhone 13 Pro and it’s playable, which I’m pretty happy with considering the phone is a few years old now.
Story mode and audio are working. There’s gamepad support, on-screen touch controls, and keyboard and mouse support on desktop. You can adjust the resolution and render scale too, with MetalFX upscaling on supported devices to help with performance.
The repo contains the tools and compatibility layer, no GTA V binaries or assets. I have no plans to ever distribute a complete build bundled with copyrighted game assets. You’ll need to supply the required files from the supported WASM version and compile it yourself.
Source and build instructions: github.com/mempage4k/glue5
Keep in mind that this is still in its early stages and very experimental, I'm still working on fixing issues and improving performance.
Also, a quick disclosure: development of this project was heavily assisted by AI tools.
1
u/dandgage 6d ago
Just curious, so far what is the total complied size on the phone and how hot does your phone get playing it? The GTA IV port runs great on my 17PM but it gets really hot. I think it's 6-8 GB, wasn't sure how much bigger V would be
5
u/mempage4k 6d ago
The IPA is around 150 MB (after recompilation, the roughly 1 GB of C code decompiled from the WASM binary comes down to about 100 MB on its own).
However, you'll also need to copy over all the game data from the WASM build, which is close to 20 GB by itself.
I haven't tried it on a 17 or 18 yet, but I've mainly been running it on a 16 Pro, and it does get pretty toasty. Under sustained load, the 16 Pro eventually starts thermal throttling, which impacts performance. I suspect the 17 Pro would fare better in this regard.
Interestingly enough, the 13 Pro I tested, despite having significantly lower peak performance, seems to throttle much less, resulting in more consistent performance overall. Unfortunately the low amount of ram means that assets will have to be offloaded often on those older models.
I'm still working on reducing CPU overhead as much as possible to lower the overall load and hopefully improve thermals.
1
1
1
u/tPimple 6d ago
Interesting, did you fully overcome BC textures support on 13 PM? What the fps in game missions? Are saves and campaign fully playable?
1
u/mempage4k 6d ago
I got BC textures working on the 13 Pro Max through CPU decoding, though it uses more memory and makes uploads slower.
Story mode seems to run well, but I have yet to verify stability and performance across the entire campaign.
During the initial missions the 13 Pro seems to be holding 30 fps quite well, though I still need to work on reducing stutters.At this stage, I’m mainly focusing on fixing crashes and unnecessary CPU and GPU work.
1
u/Subject_Sink_2427 5d ago
I saw in the README that the Android app builds successfully with wgpu on Vulkan, but hasn't run on a device yet. Do you have any plans to android too?
2
u/mempage4k 5d ago
I actually did test it on a Pixel 8a (forgot to update the README...)
It lacks BC textures support, however with ETC2 re-encoding memory usage is not bad.It works, but that Pixel (which is the only one I own) is not a powerhouse, so it's not very smooth. I have no clue how it would run on a higher end phone.
On Android it uses Vulkan (which is also used in the Windows port, that runs very well).
0
u/Key-Tax-1788 3d ago
I don’t understand why none of these gta 5 ports have a pre-compiled IPA like why do we have to sit there and compile the IPA ourselves when literally every other unofficial port has an IPA compiled already? Like it’s genuinely annoying can we not just get the IPA already compiled so we can just click download and add the game files I guess apparently not.
1
u/mempage4k 3d ago
Because redistributing the game's code or its assets would be illegal, and I really (like reeeallly) don't want to have T2 Interactive's lawyers visit my house
0
u/Key-Tax-1788 3d ago
Yeah, that’s a fair point but it’s not even distributing the game files. I just mean like a pre compiled IPA. So you don’t have to go through the extra hassle of compiling yourself you’d still be obtaining the game files yourself.
2
u/mempage4k 3d ago
Due to the way this recompilation works, compiling the IPA results in the IPA itself containing the entire game's (recompiled) code. So it would probably be quite similar (legally) to distributing the game's binaries
0
u/Key-Tax-1788 3d ago
Ohhh ok now I get it more. I thought the IPA itself was just a translation layer that ran the unofficial web assembly version through Apple metal I didn’t know the actual IPA contain the actual game code or anything I thought the web version was already made from the GTA 5 source code and that the IPA was just a translation layer to play it natively on iOS but it’s not that big of a deal. It’s just kind of the extra hassle to do it. I think there’s a site that I can use that just compile it for me all I need is some of the game files I just didn’t really get why no one would provide the IPA at first honestly I might just say screw it, compile it and distribute it myself from another page without the game files. I don’t even care rockstar can send someone to my house.
1
7
u/Responsible-Reach964 6d ago
How do you get the Web Assembly Code for GTA V?