Chapter 7. Game Builds and Submission to Apple

The last thing we need to do is create a build to test our game and then make a release build that we can submit to Apple for approval.

A few important things need to be included to make sure that our build will be submitted. The most important thing is that any application for the iOS / Apple Store needs to be compiled on a Macintosh computer with Xcode. You will not be able to submit the game without a Macintosh computer and Xcode. This is a requirement from Apple, and there isn't any solution to get around it. You also need the newest version of Xcode, which comes with the current version of OS X.

If you do not own a Macintosh or do not have access to one, you will not be able to submit your game to Apple. This restriction can be a bit frustrating and expensive, but it is part of the cost when you create games for iOS.

The first step is to download the most recent Xcode version. If you already have Xcode, you can get any updates through the Application Manager on your Macintosh machine. If you do not have Xcode, you can also use the Application Manager to download it. As of now, the most recent version of Xcode is version 6.4 and is free of charge for any OS X Yosemite user.

The next step is to create the build for the game. Although it is possible to create a build on a Windows machine and transfer files to a Macintosh, it requires several extra steps and many more solutions to problems. It is more easily solved by simply building the game on a Macintosh. Although the steps to create the build are the same for Windows and Macintosh, the transferring process creates many unique and different challenges that is not possible for me to plan for. Therefore, I cannot help you with it.

If you are able to download and install Unity 5 on your Macintosh machine, transfer the Unity project folder to your Macintosh machine before you create any build. I will use GitHub to keep the version of my games. This makes the transferring process very easy because I am able to download the same files on my Windows and Macintosh machine.

GitHub is a version control tool that is exceptionally easy to use and set up. There are many tools that can help you use GitHub; I recommend you to use a program called Source Tree, which can be found at https://www.sourcetreeapp.com/.

Setting up Unity for iOS builds

After you have your game files transferred, or if are already working on a Mac, open Unity and then your game scene if it is not already loaded.

Right-click on the Assets folder in the Project window. Then, select Create and then Folder. Name this folder IconsAndSplash.

Right-click on the IconsAndSplash folder and select Import New Asset…. Navigate to the book files and search for the folder named ChapterSeven_iOSIcons_Splash. Import the files, except the one named Icon_Template.png. This is here so that you have a reference to what the iOS icon sizing should be if you are creating a custom icon, which I recommend because the one I am including here is not specific to any game or product.

Once the icons and the splash screen are imported, select the icons; icons are the ones with numberXnumber as its name. In the Inspector window, change the settings for the icons as follows:

  • Select Filter Mode as Point
  • Select Max Size as 256
  • Select Format as Truecolor

Next, select the Splash_Screen.png file and back in the Inspector window, use the following settings:

  • Select Filter Mode as Point
  • Select Max Size as 2048
  • Select Format as Truecolor

Apple products have different screen sizes and resolutions, which is why there are so many icons. Unity does have it built-in, so you can import just the 180x180 image. Also, it will match the other resolutions in the list. I included all the sizes so that you can both know them and manipulate and customize them based on icon size if you want.

Perform the following steps:

  1. Left-click on Edit at the top selection bar of the editor, navigate to Project Settings, and select Player from the list.
  2. In the Inspector window, change Company Name and Product Name to what fits your project. For example, I will use dotVawxGames for the company name and Endless Rush Runner for the product name.
  3. Now, left-click on Select for the default icon and search for the 180x180.png image that was imported and left-click on it to select it.
  4. Then, left-click on the Resolution and Presentation tab. Now, under Default Orientation, select Landscape Right.
  5. Now, let's left-click on the Icon tab and select Override for iPhone.
  6. Then, click on the Select tab for the 180x180 option and search for the 180x180.png file we imported. With the Override for iPhone box selected, it should fill the rest of the boxes for you. If you want to have your own unique icon images for all the sizes, use the rest of the PNG files to enter the selections.
  7. Next, left-click on the Splash Image tab, and for the image fields, click on Select and then the Splash_Screen.png file that was imported:
    Setting up Unity for iOS builds
  8. Finally, left-click on the Other Settings tab. Now, under Configuration, make sure that Scripting Backend is set to IL2CPP.

    IL2CPP is now the standard to create and submit builds to Apple. If you use Mono(2.x), the build will fail to submit because Apple requires iOS Apps to support the 64-bit iOS platform.

  9. Click on File in the top-left corner of the editor and then select Save Project.

Tip

If you were to use your own art, the fields in the Icon and Splash Image fields are what you'd fill.

Creating a test build

Now that we are ready to create a build, left-click on File and navigate to Build Settings. Make sure that your Build Settings screen looks similar to the following screenshot:

Creating a test build

All of these settings are important.

Scenes In Build is the scenes that you want to include in your game. In our case, we only have the one, so this is what we include. If the scene is not in the Build Settings list and you have it open, simply click on Add Current. If you do not have the scene open, open it first and then go back to Build Settings and click on Add Current.

The Platform is also important. As we will create an iOS game, the engine will compile assets in a specific way to match the platform. If you are not on the right platform, select iOS from the list and then select Switch Platform. This will take a minute to convert your game assets to the iOS project.

Development Build is just that. It is a setting we can use to make sure that the game is build for development and allows you to test the game in sandbox mode, which allows special cases for achievements, leaderboards, and in app purchases for Game Center.

Next, click on Build. Save the build in a location that you will remember. I generally have a "builds" folder that is stored so that I can keep track of specific versions if I need to go back.

Tip

If you do not have your iPad, iPhone, or iPod plugged into your Mac via USB, do so now. You can close any programs that open when you do plug it in, including iTunes.

Navigate to the build folder you just created on your machine and double-click on it to open the folder. At the bottom of the folder, there is a file named Unity-iPhone.xcodeproj. Double-click on it to open it, which will open Xcode in the process, as shown in the following screenshot:

Creating a test build

In the top-left corner of the Xcode project, you will find a Unity-iPhone project listed. Click on it to select it.

You should see a window similar to the following screenshot:

Creating a test build

The Build Identifier field will be unique to what you had set in the Unity settings, Version, and Build.

Select the Team drop-down menu. If it asks you to log in and you already have a login save, select it.

If your device orientation is not set to as it is in the image, set the following parameters:

  • Select Portrait as OFF
  • Select Upside Down as OFF
  • Select Landscape Left as ON
  • Select Landscape Right as OFF

Next, click on the Capabilities text at the top of the Xcode project and make sure that it looks similar to the following screenshot:

Creating a test build

It is very important that you have both Game Center and In-App Purchase ON. If you don't have one of these sets, at best, the project will compile, but it won't work, or you will get a compiling error because we intend to use them.

When you click on the Game Center capability, you will likely be asked to log in. Select the login that is in the list, or if there is not one saved, log in to one and then select it.

You should now be able to click on the small play button in the top-left corner of Xcode, and the project will compile and then automatically deploy to the device you have plugged in. The game will also automatically launch on your device. You can now test the game.

When you are done playing on the device, click on the stop button next to the play button to stop Xcode from running the project.

Making a release build

To start, close out of Xcode.

If you have not already, navigate to the Assets/Scripts folder (you can change this freely on your Mac too if you are working on it now) and double-click on the GameInfo.cs file to open it. In the Start function, remove the following code:

        // DEBUGGING ONLY -- REMOVE FOR FINAL BUILD
        //     Reset Achievements
        GameCenterManager.ResetAchievements( );

This will make sure that the achievements are reset every time the player loads the game. If you have to change this, make sure to save the GameInfo file and go back to Unity so that it compiles.

To create a release build, the first step to do is navigate to the File | Build Settings and make sure to uncheck the Development checkbox.

Then, left-click on File and select Save Project.

Now, click on the Build button, not build and run. If you are planning on saving this project in the same location as the test build, go ahead, but make sure to click on Replace when the window asks you to.

When the build is done, again navigate to the build folder and double-click on the Unity-iPhone.xproj file.

Back in Xcode, again click on the Unity-iPhone project in the top-left corner. Now, on the main screen, change Version to 1.0. You can leave Build as 0.1.

You will also want to check the Capabilities area to make sure that both Game Center and In-App Purchase are on and have the correct account attached.

Now, in order to make a build that we can upload, which is in the format called IPA, navigate to the top menu of Xcode and click on Product and then select Archive.

Tip

The IPA file format is a bit like a ZIP file. It stores all the relevant information the app needs to run. In our case, it will be art assets, code we wrote, and what Unity uses, and so on.

There are a lot of things that could happen here. I want to give you all the issues that I experienced, so if you experience them, you can fix them too.

The first issue is you get an error that tells you that the app needs to be built in x64 bit.

This is solved by making sure that in the Player Settings option, you select IL2CPP. If you see this, make sure to change the setting in Unity, save the project and then create another build.

The second issue could be that you get a warning that looks similar to the following screenshot:

Making a release build

In order to fix this, left-click on the part of the warning that says Validate Project Settings.

This will open another window that looks similar to the following screenshot:

Making a release build

Click on Perform Changes and then Enable when the next window opens. What is going on here is that Xcode noticed that there are issues with the build. Also, it is offering to fix them for you.

You will have to recompile the project once you change these settings by clicking on Perform Changes. To do this, again click on Product and then select Archive. This will recompile the project and also create another IPA if you already have one.

Tip

These are two issues I ran into. If you end up experiencing something different, the Internet is full of support. Also, an answer is often as simple as a Google search away. Part of creating apps and games is fixing the issues that are somewhat unique to them.

Submitting the game to Apple

When the archive process is complete, it will open the archives window. From here, you will be able to select the IPA you want to submit. Before I commit, I usually click on the Validate button. This will run the app through a process that makes sure that it is acceptable. If it is, it will say successful. If is it not, you will see an error as to why.

If you want to validate, do so now. Alternatively, if you want to submit, make sure that the correct IPA is selected and then left-click on Submit:

You will see a window like:

Submitting the game to Apple

Again, click on Submit.

This will take some time. It has to verify the build and then upload it to Apple. Depending on your Internet connection speed, it could take more than ten minutes.

If all is well, you will be presented with a success screen, and iTunes will send you a e-mail informing you that the build was accepted. It will also offer any suggestions for settings if something is not as they expect.

Tip

In my e-mail, it told me Push Notifications were disabled, but the game had settings that could use them. It also mentioned that if I want to use them, I need to update my app settings to allow push notifications. If you see this and do not care, do not worry. Your app will still be accepted and will work fine.

The final step is to log in to iTunes Connect and then click on My Apps.

First, add at least one screen shot of the game; you must submit at least one for the screen shot option. You should also enter the Description, Keywords, Support URL, Marketing URL, and Private Policy URL parameters if not already done.

You must include an App icon that needs to be sized to 1024 x 1024 pixels and include the copyright as well. I will use my name; you can use your name or a company name if you have one.

Also, change your version number to 1.0 if it is not already.

Next, scroll down further where it says Build and click on it. It should show the following screenshot:

Submitting the game to Apple

Select the build and then click on Done.

Next, click on the small Edit text next to the Rating portion. A window will come up with a long list of themes, fill this out as best as you can for how your game is suited. For the game we made in the book, Cartoon or Fantasy Violence is checked to Infrequent / Mild and everything else is selected to None or No. Made for kids is also selected with Ages 9 – 11.

Then, click on Done.

At the bottom of the page, there is a section called Version Release. This allows you to have iTunes automatically release your game when/if its approved. Alternatively, you can manually release this version if you want to release it on a specific date and time.

In the top-right corner of the screen, click on Save.

Now, in the top-right corner of the page, there is the Submit for Review button. If you are ready, you can click on it now. It will load another page asking three questions:

  • Is your app designed to use cryptography or does it contain or incorporate cryptography? (Select Yes even if your app is only utilizing the encryption available in iOS or OS X.)

    This answer is almost always no, but if you have a special case where your app does use cryptography or incorporate cryptography, click on yes.

  • Does your app contain, display, or access third-party content?

    This is most often no, but pay attention to your game and make sure that you answer correctly.

  • Does this app use the Advertising Identifier (IDFA)?

    This checks whether you are using a third-party ad revenue service that has an IDFA. As we used iAds, we can say no here, but if you are creating a different game and using a service (such as Ad Colony), you will want to select yes.

Congratulations!

You've made it! The game you created is now awaiting approval by Apple.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset