Using the Construct 3 build service you can create an Xcode project, and use that to test and publish your game on iOS. This feature is only available to subscribers.
Prepare your project
You might want to catch up on the tutorials supporting multiple screen sizes and touch controls to make sure your project is ready for use on mobile. It’s also easy to test on mobile using Construct 3’s Remote Preview feature.
Also, make sure you fill out everything in the About section of Project Properties, such as the author, app ID, version and so on. All this information will be used by the exported app.
Export
Once you’re satisfied your project works well on mobile and is ready to be exported, select Menu►Project►Export and pick the iOS (Cordova) option.
When the Cordova options dialog appears, there’s a dropdown list labelled iOS build. Select the Xcode Project option.
Generating the Xcode Project
When you continue, your project will be uploaded to the app build service where it will be used to create an Xcode project. This can take a while. You can carry on working in Construct while the app is uploaded, turned into an Xcode project and downloaded again. The status of the build will be shown in the lower-left corner of the window.
Once the build has finished, a dialog will pop up with a “Build finished!” message, and a link to download the resulting Xcode project as a zip file.
Install pods
This step is optional. Often exported Xcode projects can successfully build right away. However some specific plugins, particularly third-party plugins, use a tool called CocoaPods to add libraries and other dependencies to the Xcode project.
For technical reasons the build service can't automatically handle this for you. So if you have an Xcode project that needs CocoaPods then you will need to install CocoaPods and then run the pod install
command in a terminal in your project folder. If you're not sure if you need to do this, then just skip this step; if something doesn't work later, then try doing this to install any pods your project may require.
Previewing your game in xcode
Extract the zip file to a folder on your macOS system. Then open the file with the .xcworkspace extension (e.g. MyProject.xcworkspace) with Xcode. If Xcode prompts you to install additional components, allow it. These are normally build tools or simulators, and can take a little while to download.
Once your project has been loaded take a look at the top left of Xcode, from left to right you should find: a play button, a stop button, the “scheme” selector and a status bar.
Click the left hand part of the scheme selector and choose the one that matches your project name, then click the right hand part and choose one of the iOS simulators. It’s generally a good idea to choose one with a smaller screen, as the higher resolution simulators will put more load on your computer. Now press the play button and Xcode will build your project and load up the iOS simulator. It will take a little while for this to happen. During the build phase you will be able to see the progress on in the status bar. Once it’s done your app will start up automatically on the simulator! If Xcode says that it’s “running” your project and you don’t see it on your screen make sure to check your dock to see if it’s opened under another window.
When your finished press the stop button in Xcode, this will stop the app and take the simulator back to the home page.
Testing on a device
Running your game on a physical device is a little harder than the simulator. If you haven’t already you will need to sign into Xcode with your developer account. On the menu bar go to Xcode►Preferences... then on the preferences window select the accounts tab and sign in with your Apple ID.
Attach your iOS device to your computer, then on the right hand part of the scheme selector choose your physical device. If you are asked if you want to use that device for development or if you trust that computer, then agree.
Next you will need to reach your project's general settings, and register this device to your provisioning profile.
To do this look in the left hand bar for the folder icon at the top and select it, then click your project in the list below. Then on the main panel select the “general” tab at the top. Under the second section titled “Signing” select your developer account on the “Team” dropdown, and ensure that “Automatically manage signing” is selected. You may see a “Register device” button below this, click it and wait a few minutes for it to complete its registration.
If you now press the play button again, it should automatically build, install and launch the application on your device. This can take some time, especially the first time you use that device with Xcode as it needs to do some behind the scenes setup.
Publishing
While publishing apps can be done through Xcode, you will need to visit iTunes Connect first to register your application.
On the iTunes Connect website go to the Apps section and click the plus button on the top left to create a new app. A small dialog should appear with a form on it for you to fill in the basic details for this new app.
You need to use the same details here as you set in C3, otherwise Xcode will not be able to link up with iTunes Connect when you publish. Additionally the bundle ID and name need to be globally unique.
- Fill in the name of your application
- Select the default language
- For the bundle ID select XC Wildcard -
- In the box below that type your actual bundle ID
- Type in a SKU for your application
When your happy hit “Create”. If your application name or bundle ID is already taken an error will appear to explain this - you should modify the values and retry until you find a unique value.
If you do change your bundle ID you can update this information in your Xcode project, in the general settings area (see above) so that you don’t have to re-export your C3 project. Bear in mind that this may invalidate your application signing. If it refuses to build after changing the bundle ID try toggling “automatically manage signing” off and on. This will clear your team value, so set it back to your developer account. Hopefully your signing information will have been regenerated and you can now successfully build again.
Now to try and push this app up to the store! Firstly on the scheme selector change the value to “Generic iOS device”. Next on the menu bar go to Product►Archive. It will attempt to build your application, and if it’s successful it will show a “build successful” message and display the archive manager. The archive manager should have one item, your new archive, in it.
At this point you can either publish to the app store or export the archive as an IPA. We’re only going to cover publishing to the App Store for now. Click Upload to App Store, and it will ask you a couple of questions. You should be able to go with the defaults. Then it will ask you a second time if you want to upload the archive, and approving will actually upload it this time (this may take awhile).
Once the upload is complete Apple will validate your build archive. If all went well your app will now be on iTunes connect. There’s a few more forms to fill out before you can actually release but you're pretty much there! Once you're happy and have everything filled out you can press the “Submit for Review” button in iTunes connect and it will be sent to Apple to check over. Best of luck!
I couldn't upload my project, help!
If you haven’t configured your application on iTunes Connect correctly it will not be able to upload your archive.
Some signing issues will cause the export to fail during the first “upload to app store”.
You may experience a warning about icons or splash screens after the validation, you will need to provide these at exactly the size they request. App icons can be modified from the project general settings under the section App Icons and Launch Images before you archive the application. If you don’t have a tool for creating images, then you can use the animations editor in C3!
Finishing up
If you’ve made it this far, and haven’t had any issues yet then that’s great news and you should be pretty proud of yourself. Xcode is a big and complicated program, and seasoned developers have been known to lose hours to obscure configuration issues. If your struggling with a provisioning error, your device won’t appear or for some reason it just won’t build then take to the forums or try checking out StackOverflow. There’s a lot of developers who have probably had exactly the same issue at some point or another so hopefully you’ll be able to find some help. If you find any steps that are missing, or there’s some pitfall you’ve come across please let us know and we’ll update this tutorial.