RetroArch on iOS 10 - not looking good :(

Looking ahead to running RetroArch on iOS 10, I started down the path of compiling RetroArch for iOS 10 a couple weeks ago (at WWDC actually :wink:

I was able to get RetroArch app to run with some minor changes on iOS 10 beta 1 - the problem was getting a core to run. On a non-jailbroken iOS device, as long as you code-signed the core (a dylib file) it can load the core ok and begin emulating. Apple seems to have tightened down on opening dylibs, as it would refuse to open it using the ā€œdl_openā€ method as it would work pre-iOS 10.

I chatted briefly with TwinAphex on IRC and he mentioned ā€œstatically linkingā€ the core, which means bundling the core with the RetroArch app. This is similar to what the PS3 version does, he mentioend. Using nestopia core as a test, I had to rebuild the core as a static library instead of a dylib, link it in Xcode - and yes it did work.

The downside is that we might need different versions of RetroArch for each core, which kinda defeats the purpose of RetroArch :frowning:

Another thing I was going to try was to include the dylib cores in the app bundle itself, and seeing if that would allow it to open the core.

If none of this makes sense to you, the bottom line is that RetroArch probably wonā€™t work in (non-jailbroken) iOS 10 unless we figure out some solution to get multiple cores working within the same RetroArch app.

If anyone has any ideas or has a better understanding of opening dynamic libraries in iOS 10, please help :slight_smile:


So basically we should go back old schoolā€¦ The way we had the dylibs bundled before inside RetorArch.app module folder. Thereā€™s only one problemā€¦ We cannot access the folders inside RetroArch.app with the current build. We used to be able to access RetroArch.app folder from earlier builds. That way is better for non-jailbroken usersā€¦ You can easily sign RetroArch with zeusmos or iPaWind and problem solvedā€¦ No need for Xcode. All the cores load with no problem. I still have a build that allows me to reach RetroArch.app folder from within RetroArch which gives me access to the signed coresā€¦ Super easy and it works.

On consoles, they use a thing called ā€œsalamanderā€ to switch between statically linked cores. This makes it feel like itā€™s all one app and the settings apply across all of them, it just blinks the screen for a split-second in between switches. However, that sort of thing may be verboten in iOS10, tooā€¦

But really, having different apps for each core wouldnā€™t be that bad, as they should all be able to load the same config file(s) and whatnot from a shared folder (documents or whatever), so youā€™d still benefit from that consistency.

Did some additional tweaking. I was able to load multiple cores in RetroArch by code signing the cores and including them in the app bundle.

I put the cores in the pkg/apple/iOS/modules folder, and modified RetroArch to use this folder only for iOS 10. The dylibs were loaded successfully and it works as before, I think!

The downside to this is that you cannot use the Online Core Updater and you cannot add cores manually using iExplorer or iFunBox or whatever utility used to access the (non-jailbroken) filesystem. Iā€™m not sure if its possible to run RetroArch without building it yourself in Xcode because of this. I think it should be possible to use something like iResign to resign the app and its dylibs. Iā€™m adding a script to code sign all the cores as part of the build process.

Thanks Zero2029 for the hint!

Itā€™s good to know that everything is working on iOS 10ā€¦ In case I decide to update to iOS 10 beta in the future. I highly believe that it is possible to still sign RetroArch with the cores included with a service like Zeusmos or iPAWiNDā€¦ Thatā€™s what I used to do; the cores were signed and working. Keep in mind that you could also create an archive from your RetroArch Xcode build and turn in to an ipa and sign it with Zeusmos or any other serviceā€¦ Itā€™s real easy. However, Iā€™m glad I was able to help Harakari2. :blush:

Just confirming your setup, harakari2. You put the cores you want in the modules folder, then built RetroArch in Xcode to install on your device. Then in RetroArch you change the Core Directory in the Directory settings page in the app? Or am I missing something in Xcode that you can change before building the app?

[QUOTE=volcanopele;42396]Just confirming your setup, harakari2. You put the cores you want in the modules folder, then built RetroArch in Xcode to install on your device. Then in RetroArch you change the Core Directory in the Directory settings page in the app? Or am I missing something in Xcode that you can change before building the app?[/QUOTE] also would like to know will code signing the cores in terminal work? I tried installing retroarch on 9.3 and I couldnā€™t get the cores without a jailbreak maybe I was doing something wrong when code signing I know I got my iOS development revoked somehow I think for installing RA cores. Iā€™m not a dev but I payed 100$ just this year for all their latests betas and to be able to keep whatever I wanted on my phone but I feel as if using my developer account to sign RA kinda screwed me as I kept repeating processes since Iā€™m new to all this

Just confirming your setup, harakari2. You put the cores you want in the modules folder, then built RetroArch in Xcode to install on your device. Then in RetroArch you change the Core Directory in the Directory settings page in the app? Or am I missing something in Xcode that you can change before building the app?

Note that this is only if youā€™re building the RetroArchIOS10 target, only for iOS 10. The latest master branch for RetroArch has my changes that TwinAphex merged. If you set your target as RetroArchIOS10, you put the cores you want in the iOS/modules folder, and then build in Xcode. The build process will code sign the cores. You donā€™t have to change the Core Directory in the Directory settings page - it should be set to the modules directory, and you should not change it (it should be ā€œ:/modulesā€ if you look at the cfg file).

If youā€™re building for iOS 9, use the RetroArch or RetroArch iOS9 rarget, and you put the code-signed cores in the Documents/RetroArch cores directory in the app. This directory is accessible in iExplorer and you can copy them over that way.

also would like to know will code signing the cores in terminal work? I tried installing retroarch on 9.3 and I couldnā€™t get the cores without a jailbreak maybe I was doing something wrong when code signing I know I got my iOS development revoked somehow I think for installing RA cores. Iā€™m not a dev but I payed 100$ just this year for all their latests betas and to be able to keep whatever I wanted on my phone but I feel as if using my developer account to sign RA kinda screwed me as I kept repeating processes since Iā€™m new to all this

Yes, code signing the cores in terminal should still work. Iā€™m not sure what build/target of RetroArch you have, but you should be able to code sign your cores and put them in the Documents/RetroArch/cores directory. If it still doesnā€™t work, and it crashes - make sure itā€™s code signed, and make sure your certificate is not expired. You can check on your certificate in the Keychain Access app on your Mac.

You can check signature of a dylib by doing the following:

codesign --verbose=4 --display nestopia_libretro_ios.dylib

The gist of it is:

iOS 10: cores cannot be loaded from the appā€™s Documents directory. It needs to be bundled in the app, in the modules folder. You can include the cores when building in Xcode, or (this is untested) you can have an IPA with all the cores included, and you re-codesign (using iResign or similar tool) the IPA. As time nears or the release of IOS 10, i can make this IPA available.

iOS 9: cores can be loaded from the appā€™s Documents directory, just need to codesign them.

Okay, thanks! I donā€™t have the beta installed (yet), so for now I will just stick to the regular iOS 9 target and /Documents/cores folder, but this is good to know if I decide to install the public beta.

This does seem like a more annoying way to get cores into RetroArch, but honestly, I donā€™t update the cores very often anyway. As long as I find ones that work, Iā€™ll stick with what I have.

Thanks for the reply

Iā€™ve had a go with the iOS 10 build and itā€™s working fine for some cores like MAME but the PSX Rearmed Interpreter and Yabause donā€™t seem to load when I select them. Is this a known issue?

Just gave pcsx_rearmed_interpreter a try (now that I have iOS 10 on my iPad) and tested it with Quake. It seems to run fine.

The only core Iā€™ve had a problem was mupen64plus, but I guess that shouldnā€™t be a surprise since it seems to have been pulled in the last month so Iā€™m working off an older version of the core. But that was working under 1.3.4 on iOS 9 as recently as a couple of days ago. Iā€™m just seeing different issues with different games for example, no down in Mario Kart. Also the iPad overlays for N64 and PS1 are bugged. I get crashes when switching between the different panels in the overlays. The regular gamepad overlays work fine though.

Aha, I think I see whatā€™s happening. When I add a new core to the iOS/modules/ directory it copies over to my device correctly but when I select Load Core in RetroArch it just says (No Core) at the top (which is what I was getting yesterday).

If I then hit Stop and then Play again in Xcode and select that core it actually loads (and it works too). Could it be signing the cores after Xcode has copied them to the device which is why they work on the second run? Iā€™ve tried this with seven cores now and it seems to consistently work on the second run for each one Iā€™ve tried (Mupen64, PSX Rearmed, Yabause, Mednafen PCE Fast, SNES9x Next, MAME 2000 and MAME 2003).

Hi I am sorry, but my English isnā€™t good. I have retro arch 1.3.6 non jailbreak over cydia impactor. I want play the psx game The legend of dragoon or crash bandicot, but I choose load core and then load concet a I choose pcsx_rearmed_interpreter and I find The legend of dragoon iso or bin and confrim and app crashes. What am I doing wrong? I want play psx game but I donā€™t want jailbrake and android phone :frowning: Itā€™s here chance for play? Thank you

Have you tried putting the bios on System folder?

Also, why tou dont try the latest retroarch app?

Does the PSX core appears on the top? If so, then it was signed correctly with impactor.

I had last version 1.4.1 unfortunately the same problem. I didnā€™t put the bios into the folder.It is maybe this the problem, isnā€™t it? Yes the PSX core appear on the top.

Try the latest retroarch, and try placing the bios. Lets see what happens, CB should work anyway without them.

All right just download Retroarch 1.6.0 from the link below and test the psx core. Bios files are optional. All cores are available including N64. Use cydia impactor to install it.