Feature Request: Investigate feasibility of iOS support (prototype attached)
See original GitHub issueFeature Request
What feature are you suggesting?
Overview:
Ryujinx recently added support for macOS Apple Silicon / Metal. This support can be used as the foundation for an iOS port.
I made a terrible prototype Ryujinx launcher that launches an unmodified Ryujinx 1.1.0-macos1 build on an iPhone 14 Pro on iOS 16.1. It barely runs a homebrew game, but it proves that iOS support may be possible.
I do not expect iOS devices to be able to run games at full speed and fidelity in the short term. However, they may be able to emulate small/simple games.
I’m not sure how feasible or worthwhile an iOS port would be, so I’m creating this feature request to list the limitations / challenges I encountered when building the prototype.
Please let me know whether this is worth pursuing, and what I should do to help.
Smaller Details:
For my prototype, I used:
- Modified .Net Core CoreCLR v7.0.1.
- I chose this instead of e.g. MonoAOT since Ryujinx is only tested on CoreCLR and I don’t want to debug MonoAOT incompatibilitiess
- As a hack, CoreCLR is built using the macOS target (i.e
OperatingSystem.IsMacOSis true andIsIOSis false), but using the iOS SDK, to minimize the changes required
- Unmodified SDL2
- Slightly modified MoltenVK
- Ryujinx’s 1.1.0-macos1 binary release, extracted using sfextract and patched to backport the x18 fix from the pull request
- Ryujinx.Headless.SDL2 built from source, with some changes to match the binary build.
- A launcher that loads CoreCLR and starts Ryujinx.Headless.SDL2
This was enough to run Helltaker, a homebrew 2D Unity game by D3fau4 / vanripper - with occasional crashes from running out of memory or the GPU not responding (probably also out of memory?).
I did not try running any commercial games, because it barely ran a 2D homebrew as is - I doubt it’d would be able to handle anything more.
The main issues preventing Ryujinx from emulating a Switch on iPhone are:
-
lack of physical memory: The Switch has 4GB of RAM, and Ryujinx itself requires at least an additional 1.5GB of RAM. The iPhone 14 Pro only has 6GB RAM total. According to jduncanator, there is also significant extra RAM usage from Ryujinx emulating VRAM and decompressing/recompressing textures.
-
lack of virtual memory: A desktop computer gives each application hundreds of terabytes of virtual memory. ~iOS gives each app less than 8GB by default (!!)~ ~This is barely enough to fit Ryujinx’s various reserved memory regions, such as the emulated 4GB Switch memory or the 512MB JIT cache.~ ~Even with a $100/year developer membership, you can only get 64GB of virtual memory.~ Update (2023-01-22): I was wrong: free apps can ask for 64GB of address space using the extended memory entitlement. This is still well below the amount you get on desktop platforms.
I had to patch Helltaker’s .nca npdm flags to choose a 36-bit instead of a 39-bit address space, because there’s not enough host virtual address space to allocate the 1GB JIT pagetable Similarly, I intercept the mmap for 2GB of JIT cache and return only 512MB, since there’s no space for 2GB.
JIT Host memory will probably never work, as discussed on Twitter: even with a paid account you get only 64GB of host address space, or 36 bits, so host emulation would leave no memory for Ryujinx itself.
-
lack of hypervisor support: Ryujinx on macOS uses Hypervisor.framework to run Switch’s CPU code directly iOS does not offer this framework, so Ryujinx has to fall back on the slower JIT.
-
missing Metal features Even in Helltaker, a simple Unity-based homebrew, Ryujinx on iOS fails to render the selected highlight around its menu options. Ryujinx on macOS Apple Silicon does render it correctly, so it appears iOS Metal / MoltenVK is missing features.
-
Apple’s stance on JIT and emulation Emulators are not allowed on the App Store, so emulators must be sideloaded. This is much more involved than downloading apps from the store: the user must set up some way to sideload the app, for example, using AltStore, and the app must be re-installed every 7 days. While sideloaded apps can access JIT (unlike app store apps), the procedure is a hassle to set up.
Nature of Request:
- Addition
- Investigate whether Ryujinx can be sideloaded to iOS devices with >=6GB of RAM, and what its limitations would be
Why would this feature be useful?
For users, it would offer an additional option to emulate games on the go.
- Android devices already have a popular Switch emulator (Skyline). This shows that there are users who want to emulate the Switch on mobile devices.
- While emulators are not allowed on the iOS App Store, iOS users already have access to several emulators through sideloading, such as Delta and Dolphin-iOS. This shows that iOS users are interested in emulation.
Issue Analytics
- State:
- Created 9 months ago
- Reactions:18
- Comments:39 (12 by maintainers)

Top Related StackOverflow Question
Well I am no dev by any means, nor I can contribute by any means other than may be patreon support. I just wanna make few points that I believe represent the wish/opinion of thousands of iOS users. First of all we thank zhuowei, jd, and gdkchan for your time to even discuss the possibility of an ios port. we are much thankful for your other works as well.
In the end all I wanna request with lots of gratitude is that, please don’t close this request, even if its low priority, keep it open, who knows within few months ios becomes more emulation friendly with upcoming os update. We as a community will forever be grateful to you and those who are contributing to community of gamers. Thank you so much.
Thanks for all your work on this, I’ve been eagerly following your work on Twitter the last couple of days.
I think until we see an iPhone with 8GB of RAM released, that the market for this is going to be pretty slim. Skyline works (and can potentially be an actually useable emulator) because Android devices exist with 8GB and 12GB of memory.
With that said, there is a lot of potential for optimising memory usage on UMA architectures, and with the better memory API’s available on macOS/iOS a lot of the VA used for address space mirrors (etc) could be optimised.
The 64GB of VA is always going to be a killer though. If anything, Ryujinx is likely moving in the direction of requiring more VA rather than less, with things like multi-process (and applet support) something that will likely come on the radar in 2023. Both of those things require maintaining a separate 36+ bit VA for each process/applet. You might be able to cobble together a build for iOS that didn’t support those features, but the question is then about how many compromises you’d need to make before it’s not worth it anymore, rather than is it possible at all.
I know there is an entitlement for a larger address space on iPad Pro’s, is that the same thing as the paid expanded 64GB VA on iPhone, or is that expanded address space even larger on iPad? Perhaps a more realistic target is Ryujinx on iPad…
All in all, thanks massively for your work. Especially the launcher code, and the detailed documentation you’ve made, this will make it much easier for anyone to dabble with Ryujinx on iOS in the future.