To start you’ll need:
A Mac with Xcode 7 (download from the Mac App store)
An iOS device running iOS 9 or later
An Apple ID
First, you’ll need the source code:
Open Xcode 7
Go to the Source control menu > Check out
Enter: https://github.com/libretro/RetroArch.git and download the directory files to your desktop, documents or wherever you choose.
Select the “master” branch.
You can also use Terminal to download the RetroArch directory. Just open Terminal and type “cd desktop” then type “git clone https://github.com/libretro/RetroArch.git” of course without these “ symbols. RetroArch folder should download to your Desktop.
Next we need to make an iPhone developer certificate to ‘codesign’ the app and its cores. This can be done with just an Apple ID and not a paid developer account thanks to Xcode 7 and iOS 9:
In Xcode 7 go to Xcode>Preferences and then click on the accounts tab.
Sign in with your Apple ID and click on ‘view details’
Click on the create button next to iOS development.
Alternatively to the Above this can be done through keychain access>certificate assistant>create a certificate>iOS development.
Then we need to build the base Retroarch App:
In Xcode go to Window>Projects and select the Retroarch (or Retroarch_ios) project. This will be here if you correctly downloaded the source code through Source control menu > Check out. ****Alternatively go to your downloaded RetroArch folder then open the RetroArch_iOS.xcodeproj file inside RetroArch/pkg/Apple/RetroArch_iOS.xcodeproj.
You should see the project open up… let it load.
Connect you iOS device by USB
Select your device as the target in the top leftish corner next to the play and stop buttons.
Select RetroArch (not RetroArch iOS6) for the TARGET on the left. Then under the general tab in the centre of the window, under Identity give your bundle identifier a unique name e.g. com.<anything>.RetroArch, you could use com.new4ios.RetroArch as long as that its never been used for an App before.
Also under Identity, select your iOS development licence under Team, if you don’t see your licence here, select add an account and follow the prompts. After selecting your Team it will prompt you with another message: ‘No matching provisioning profiles found’. Click on ‘Fix Issue’ and you’re set.
Under the general tab in the centre of the window, under ‘Deployment Info’ select iOS 9 as the Deployment target
You might se a yellow Triangle symbol indicating to “Update to recommended settings.” Go ahead and update to recommended settings.
Not to sure if this step is necessary but Select “Product” at the top then select “Scheme” then “Edit Scheme.” A window should pop up. Change everything in all sections (Build,Run,Test,Profile,Analyze, and Archive) from “Debug” to “Release.” Close the window afterwards.
*** This step is necessary otherwise you will get nothing but errors and you won’t be able to build/compile RetroArch correctly. Go to your downloaded RetroArch folder and open it. Look for the “media” folder and open it. Create these folders: assets, autoconfig, cores, libretrodb (inside libretrodb folder create: cut,cursors and rdb folders), overlays and shaders_glsl. You don’t have to put the necessary files in them but go ahead and do so if you prefer.
Now if you’re ready for PRIME time let us build and compile RetroArch. Make sure to select your device as the target in the top leftish corner next to the play and stop buttons. Now click on the Play button to build and run the current scheme… let it finish. It will give you a few errors along the way but don’t worry RetroArch will be installed on our phone. If the iOS simulator opens just close it.
Congratulatons!!! RetroArch should be installed if you followed instructions and did everything correctly. However, we’re not done yet. We need to codesign the cores. Keep reading below to learn how to coding the cores.
DO THIS STEP ONLY IF YOU WANT AN ARCHIVED VERSION WHICH YOU CAN TURN INTO AN IPA Go to Product>Archive to build the App, this may fail due to licensing, if this happens you should see a window popup with a ‘fix issue’ button. Click this button to fix the issue and It should compile successfully. An archives window will popup when you successfully build the app. In case you close the window that pops up go to ‘Window’ and then ‘Organizer’. There you should see you archived version of RetroArch. You can right click and then click on ‘Show in Finder’. Then right click the archive again and choose ‘Show Package Contents’. In there you will see its contents.
The App has now been signed by compiling with your Apple ID developer licence, now we need to get and codesign the cores:
Download the latest iOS 9 cores from: http://buildbot.libretro.com/nightly/apple/ios9/
Once downloaded, the cores will need to be codesigned. I feel this is easiest done in terminal, if you’re not familiar with terminal here is a basic guide:
Open Terminal on your mac, Terminal should open up to your User folder on startup by default.
You can see the folders in your current directory by typing the command ‘ls’ (without the quotation marks of course).
You can change to a different directory by typing 'cd <name of directory> for example ‘cd Documents’ or ‘cd desktop’
Navigate to the folder with the downloaded cores, again, you can see if you’re in the right place by typing ‘ls’. If you see the list of cores, you’re in the right place. Download the cores to your desktop to make it easier.
Once here type the command: codesign -fs “iPhone Developer: <name or email> <(assorted numbers and letters here)>” <core name here>.dylib
To find your developer details oper keychain access, and look for the iPhone Developer certificate under the ‘login’ tab
An example might be: codesign -fs “iPhone Developer: [email protected] (X3D4A7892)” pcsx_rearmed_interpreter_libretro_ios.dylib
If you’ve done this correctly Terminal should tell you that it is 'replacing existing signature’ but not necessarily.
Your core is now codesigned! You can download iFunBox from the web and drag it into the cores folder on your phone.
Now you can run the app:
On your iPhone go to settings>general>profiles and select your developer certificate
Trust your provisioning profile
Open the app
Go to the ‘online updater’
Update everything EXCEPT THE CORES, updating core info is fine.
You’re good to go!
Roms:
Add roms using iFunBox. Go to RetroArch and create a folder or folders for your roms. Example: n64 roms or psx roms. Then drag the roms inside their corresponding folder.
For the n64 roms to work you need to change the CPU Core from dynamic_recompiler to cahed_interpreter. If you can’t change it within the RetroArch app then manually do it. Open ifunbox and open RetroArch. Navigate to the ‘configs’ folder and open it. In there you should see a file ‘retroarch-core-options.cfg’. Drag it to your desktop and open it. I use windows notepad to edit it. Now edit these lines and change to: mupen64-cpucore = “cached_interpreter” and thats it. Now drag this new edited file back to the ‘configs’ folder and delete the old one.
The n64 core should load up and run roms without a problem now.
Bios:
PSX bios should be copied to the System folder with iFunBox