This page explains how to compile your own version of ScummVM using the iPhone or [[[iOS7]] backend.
You can compile ScummVM with the official tools from Apple and get it to work on your non-jailbroken iPhone or iPad.
You will need:
- a macOS computer
- Xcode (you can get it for free from the Mac App Store)
- A developer account. You can create one for free using your Apple ID (the same one used for iCloud or the Mac App Store) on the Apple Developer Member Center.
- iOS libraries used by ScummVM. There is a link to a convenient package below in the build instruction.
Note: with a free developer account iOS App that you build will only be valid for 7 days and you will thus need to recompile and reinstall them each week.
Creating the Xcode project
Clone the ScummVM repository from GitHub to get the source code:
git clone https://github.com/scummvm/scummvm.git
Generate the create_project tool:
Create a build directory, extract the iOS libraries package and generate the Xcode project
Download the iOS libraries package and extract them in the build directory:
Generate Xcode project and open it:
../scummvm/devtools/create_project/xcode/build/Release/create_project ../scummvm --xcode --enable-fluidsynth --disable-bink --disable-mt32emu --disable-nasm --disable-opengl --disable-theora --disable-taskbar --disable-libcurl --disable-sdlnet
Compile and Deploy
In Xcode you need to configure the scummvm project:
- Connect your iPhone or iPad to your Mac.
- Select your iOS device (iPhone or iPad) at the top of the window (in the title bar).
- In the project General settings you need to specify a unique Bundle Identifier (for example org.yourname.scummvm).
- You need to configure the ``Signing`` settings. Add an account by using your Apple ID if needed and then select it.
Then click on the Play button in the top left of the window to start the build. The App will be automatically installed on your device at the end of the build.
TODO: Add a bit more details.
There are some outdated instructions on this blog that may still be useful as it is illustrated and has more details.
Please note binaries generated with these instructions only work with jailbroken devices.
First you need to set up a toolchain for cross-compilation. On our buildbot we use this toolchain. It is based on LLVM/Clang and contains instructions on how to set it up.
In the previously linked toolchain a script to compile all libraries used by the iOS version of ScummVM is contained. Please refer to the toolchain's README file on how to build them.
Before we can compile ScummVM we need to configure the source tree for building. This is usually only required once or when you want to alter build options.
Choosing an iOS target
We feature two different iOS backends:
- iphone: Our legacy iOS backend, which supports all iOS3+ devices.
- ios7: Our modern iOS7+ backend, which only supports iOS7+ devices but features better integration for these.
Depending on which backend you use you will need to use a different value for the TARGET environment variable.
Setting up the Environment
export CPPFLAGS="-isystem $IOS_TOOLCHAIN_BASE/$TARGET/usr/include"
Where IOS_TOOLCHAIN_BASE contains the directory where you installed the toolchain. And TRAGET has been setup from the previous step.
NOTE: If you quit the shell you are using when configuring ScummVM and pick up compilation later, you will need to re-export only the PATH variable like described above.
Configuring the Build
Then configure ScummVM for the iOS version you want to target.
First, navigate to a path where you want your build files to be located (this can be the ScummVM root directory but does not have to be).
Then run the following:
./path/to/scummvm/configure --host=ios7 --with-staticlib-prefix=$IOS_TOOLCHAIN_BASE/$TARGET/usr
Replace ios7 with iphone if you want to build the older version of our iOS backend.
You can compile ScummVM with running make:
If you simply want to test whether changes you made compile but do not plan to use the binary for deployment you can also simply run make.
Please note that if you want to deploy ScummVM on your iOS device you will need to generate a bundle file. For this run either:
for the ios7 backend. Or
for the iphone backend.
Then simply upload the whole ScummVM.app directory to your device under the /Applications folder, and you're done!