To publish to our device we will have to provide a bundle identifier for Unity. To create one we will have to provide one within the iOS Provisioning Portal. This portal is located within the iOS Dev Center accessible at http://developer.apple.com.
On the main page for the iOS developer program you will find a link that will take you to the iOS Provisioning Portal. In addition, you will see links to the iTunes Connect portal that is used for publishing your product and getting information about sales and market performance:
Let's take a look at how we create App IDs for our applications:
An App ID for an iOS application is very important, as it is the mechanism through which the application will be uniquely identified by Game Center, in App Purchases, Push Notifications, and inside of the Unity development environment:
An application identifier has a description, a prefix and a suffix. The prefix is a collection of characters that are randomized for uniqueness, and the suffix represents the unique identifier for the application. When Unity refers to the Bundle Identifier, it is referring only to the suffix.
Create your App ID with a clear description of what this application is so that it will be easy to find it later. This is important, as over time you will end up with a large number of App IDs for all the games you will be creating. For the Seed ID itself, simply leave that set to Generate New.
For your Bundle Identifier , use the standard reverse-domain name notation to come up with the identifier for your app. Once this is created we just need a way to move this over to our development environment.
You may not have noticed it, but this example illustrates what happens when you follow the bad practice of not coming up with very descriptive names for your App IDs. While in this case I know that I want Chapter 1, if I were developing several books – I would not be able to identify which Chapter 1 this App ID represented.
Notice that I have selected all of the devices that I want this application to be provisioned for. If you don't select a device here, you won't be able to deploy the application to that device.
.mobileprovision
file), double-click on the file on your machine. As this is a registered file type for XCode it should install it into XCode for you.If for some reason it doesn't, you can open up the Organizer in XCode (Window | Organizer), select the Provisioning Profiles entry in the organizer. XCode will then install the profile and it will be synchronized to all devices that can accept the profile:
XCode has the ability to automatically provision devices that are configured in the iOS developer portal within XCode. This makes it easy to ensure that your profiles are added to your target devices. To do this, ensure that the Automatic Device Provisioning checkbox is checked:
Once performed, XCode will communicate with the iOS developer portal and download all of your configured devices and display them in the Organizer:
com.gregorypierce.chapter1
:With that step completed, the hardest part of building games for Unity is over!
Don't be alarmed when you see XCode open and start building your application, as this means that the process is working and very shortly you should see the sample application start on your device.
What Unity is doing behind the scenes is taking all of the assets and scripts from the Unity IDE and putting together a player that will be able to playback the content and all of its scenarios based on input from the user. This is a very important concept to understand as the content within the Unity IDE is largely platform agnostic and can be readily redeployed after a simple recompile within the Unity environment. This player is what becomes the actual application that is deployed to the iOS device.
We spent a large number of steps creating some artifacts within the iOS Developer Portal. These artifacts were: the certificate, the App ID, and the provisioning profile. These artifacts form a circle of trust between the developer, Apple, and the iOS devices in the hands of developers and consumers.
The certificate is a credential that is created in the Apple environment that allows content to be signed specifically by the developer, so that it is clear who authored the content. Without a certificate it is possible that someone could claim to be the developer and sign applications on his/her behalf.
The App ID is a unique identifier that allows the iOS device and the Apple services to know, without ambiguity, which application is trying to do something. Finally, the provisioning profile defines.
The provisioning profile associates the certificates, devices, and an app ID. Without a provisioning profile on your machine you will not be able to sign or deploy applications to either a device or to the application store.
Once we provided Unity the App ID, it was able to communicate with XCode and tell XCode which profile and certificates should be used to sign our application and deploy it the iOS device. On the device itself, when XCode deployed the application it transferred the provisioning profile to the device, so that the iOS device could identify that this was a device that it should run, even though the Apple App Store did not provide it.
We have just performed all of the steps necessary to setup our development environment and publish content to Unity. Further, we have built our own mini testing lab using Unity Remote so we can utilize our device yet debug the game in our development environment. This is a crucial milestone as we can now focus entirely on customizing Unity and building games.
3.134.77.195