Hi
I was having some difficulties getting the demo to build for iOS so I would just like to share my experiences in case anyone else is having difficulties. First a huge thanks to @digitald82! Most of this is derived from his findings, but I just wanted to expand a bit on it. I am brand new to Mac and iOS development so please forgive me if some of these steps are obvious anyone familiar with development on those platforms already! I am developing on macOS Sierra 10.12.6, Unreal 4.17.2, and targeting iOS 9.0 on an iPad Pro.
Expanding on the steps in the getting started guide for the full version:
- You will need a Mac computer to package your code project for IOS devices!
- Setup your iOS development environment https://docs.unrealengine.com/latest…art/index.html
- unreal engine editor (4.17)
- Create a new C++ code project without starter content targeting mobile
- Copy all files from SampleProject directory to your new project directory and merge the folders
- In UE4 editor File -> Refresh xcode project (optional) – I’m not sure what this does…
- Exit from unreal engine editor
- your new project from epic launcher
- You should be prompted about “This project requires the ‘ARToolkitPlugin’ plugin which is not compatible with the current engine…” “Would you like to disable it?”, click No.
- When it prompts to rebuild the plugins, click Yes.
- Go to edit -> project settings -> Platforms -> iOS and import your mobile provision and certificate files.
- Also on the iOS settings, update the Bundle Display Name, Bundle Name, and Bundle identifier. If this all matches with your provisioning profile, then the profile and related certificate should turn green. Also as a side note, I haven’t had much luck using wild cards so my bundle identifier is specific to my app. You also need to add the additional plist data:
<key>NSCameraUsageDescription</key><string>Camera is used for AR functionality</string>
- Project settings -> Project -> Maps & Modes, set your Game Default Map to ARToolkitAdvanced. While you’re here, you can set the Editor Startup Map to the same thing if you like.
- Project settings -> Project -> Packaging, set Additional Non-Asset Directories To Copy to your project’s Content/ARToolkit folder. Digitald82 had also mentioned the Additional Non-Asset Directories to Package as also being set to the ARToolkit folder, but I didn’t find this one to have an effect one way or the other.
- File -> Package -> iOS. Select a directory for your iOS build and click Open. The first time you package your project, this takes a very long time if you have a slow machine like mine, but it’s much more tolerable after that.
In my case, I made a Package directory in my project.
- After the packing is done, we need to check that the case of the file structure aligns with what the plugin is looking for. Go to your Package/IOS directory, make a copy of your .ipa and rename it .zip.
- Extract the zip to produce a payload folder. Inside there will be your app. Right click and “Show Package Contents”.
- In the packaged contents, navigate to cookeddata -> <Your App Name> -> content -> ARToolkit and take note of the case of the subfolders. In my case there are “Data” and “DataNFT”.
- Close the Unreal Editor and go to your project directory -> Plugins -> ARToolkitPlugin -> Source -> ARToolkitPlugin -> Private and edit ARToolkitDevice.cpp.
- On line 676, check that the case of “Data” matches what you found in step 18. In my case, it was a lower case “data”.
- On line 968, check that that the case of “Data” matches what you found in step 18. In my case, it was a lower case “data”.
- On line 1054, check that that the case of “DataNFT” matches what you found in step 18. In my case, it was a lower case “datanft”.
- Save your file and close.
- Navigate to your project folder -> Plugins -> ARToolkitPlugin and trash the Intermediate and Binaries folder. Reload your UE4 project and it will again prompt you about the incompatible plugin (click No), and then rebuild (click Yes).
- Assuming that you had to change your plugin source, package your project again (it should be much faster this time).
- To transfer your ipa to your device, you need to use Xcode (the ability to do so with iTunes has been removed…). Load up Xcode and go to Window -> Devices and Simulators.
- Assuming your device is plugged in, click the + under the installed apps, navigate to your ipa and click open.
Your device should now have the demo loaded and it should prompt you for camera access when you open the app for the first time.
One other bonus note. To get the UE4 logs from your device, while the device is plugged in, from the Devices and Simulators window, select the installed app, then click the gear and select Download Container… Select the location for it and after it is copied, right click to Show Package Contents. In the AppData -> Documents -> <app name> -> Saved -> Logs will be your file logs generated from your app. If your still having some troubles, this log might give you some more hints.
Hope this helps anyone new to using this awesome plugin on iOS!