How to bring a game from unity to an iOS device

Source: Internet
Author: User

When I started developing my own iOS game, the first thing I thought about was how to export it to my device so that I could test my game so effectively. Initially, the process seemed long and complex, and the main problem I encountered was that, despite the many resources, they were not entirely from the same place, so I had to combine them and match them together through a variety of tutorials. So I decided to summarize this process in one step by this article. This is some of the ways I have been followed so far, and hopefully it will also bring more help to people at the same stage of development.


1. Get Unity and iOS exporter

If you have not yet done so, you first need to download the latest version of Unity on the official website. There are 2 versions, the free version (Http://unity3d.com/unity/download) and the Pro edition (https://store.unity3d.com), so you can make a choice based on your needs. Since May 2013, mobile phones have come with their own exporters, so you don't have to spend money on them.

2. Sign up for Apple developer program

The next thing you need to do is to join the Apple Developer program, which is the necessary process for setting up your development certification. You will need to pay $99 per year to join the program, and you'll be required to register through the following developer sites: https://developer.apple.com/programs/ios/(Once you've registered and paid for the fee, You will receive an activation email to help you join the program and allow you to use all the features you need.

3. Download and install Xcode

The next thing you do when you join the developer program is to download and install Xcode. This may be confusing at first, and some of you will know that Xcode is a user-created native app for iOS. and unity uses Xcode as a mediator to bring content to the iOS device, so you don't really get into Xcode, all the development will happen on unity, and Xcode's role is to import the content from unity into the device. You can download xcode:https://developer.apple.com/xcode/from the Apple Store. After completing the download, make sure to install it before proceeding to the next step.

4. Create a Developer profile

So far you should have downloaded unity and Xcode and activated your Apple developer program membership. Now, in order to direct your game from unity to the device, you need a developer profile (which will allow you to port the game you have developed or any test to your device). Apple offers two types of configuration files, the developer profile for development and testing, and a distribution profile for submission to the Apple Store. To create a developer profile, you need to do 3 things: Register your device/build an app ID/get a certificate.

You can do these three things through your Apple developer program. So navigate to this address: https://developer.apple.com/, then go to the member Center from the top menu. Sign in with your Apple ID and password.

Now choose certificates, identifiers and profiles, and you'll be able to access and manage your profile, Apple ID and more.

1) Register your device

Select the device in the certificates, identifiers, and Profiles sections. Because this is necessary for Apple to identify the specific device that is used for testing. This does not change any settings on your device and you can easily use the devices you use every day. When registering your device, you can click the + button to add a new device. Then you need to fill in the name of the device (which can be any name) and Udid (the unique ID of the device). You will find yourself able to register more than one device for testing, which is helpful if you want to test based on different devices (such as an iphone and an ipad).

In order to find the udid of your device, you need to connect your device to your computer, then open itunes and click on the iphone button (top right of the interface) and you will see that the device information contains the name. Then you can hover over the mouse and click Serial number, which will become a regular identifier, which is Udid.

This is the number you need and you have to copy and paste it into the ID section of the Member Center portal. Now you are ready to register your device. Remember that once you register your device, you can only change its name and not change the udid.

2) set an app ID

The next step is to set your app ID. Still in member Center portal certificates, identifiers and profiles, select the app ID and click on the + button.

Start by providing any description you want, as long as it helps you remember that your ID is used to do what you can. A good way to do this is to use a unique name for an app and use a common name for a test app. Next you need to set up bundle Identifier, which is presented in the form of the opposite domain symbol.

That is: COM + your full name (if you are an individual developer) + Your game name:

Com. Yourname.thegamename

This type of bundle ID will be clear and can only be used in a single game. So you need to use a different name for each of your games. This is useful, however, which allows you to access services like "Game Center" and "app internal purchase".

On the other hand, the bundle ID of wildcard is presented in the following form:

Com. Yourname.*

This replaces the game's name with an asterisk. This format allows you to use the same ID in multiple apps without having to set a different name each time, but this does not allow you to use a specific device.

Now you have chosen to continue and confirm the app ID. Record the bundle ID as you will need to use it in Unity's build settings later.

3) Get a developer certificate

The first thing you need to do is get certificate Signing Request from your computer. Go to Applications > Utilities > Keychane Access, then Preferences > certificates. Make sure that the online Certificate Status protocol and Certificate revocation list are off and preference is off. Now go to Certificate Assistant in Keychane access and select Request authority from the Certificate Certificate. Provide the same details you used when registering for the developer program and click Continue. Provide a name and save to desktop. Select 2048-bit body and RSA on save.

You should now have a file with a. certsigningrequest prefix in your desktop.

Now go back to the certificates, identifiers and Profiles sections of the member Center portal, select Certificates > Development (as you would for a development certificate), then press + Press the key to create.

Choose to upload the certificate Signing Request that you saved in the desktop. Before you commit, make sure to scroll down the page and find WWDR Certificate in intermediate certificates. You can download it when you need it later.

Now commit, your certificate Signing request will be sent to Apple and replaced by another content you can download. It will be named: Ios_development.cer

So now you should have two certificates on your desktop. That is, Ios_development.cer and WWDR Certificate, you need to double-click the two certificates to install them in Keychane Access. Now you've set up your developer credentials.

4) Create configuration files

After completing the three steps above, you can now continue to create the configuration file. Still in member Center portal certificates, identifiers and Profiles, go to Provisioning Profiles > All and press + button to create a completely new configuration file.

Make a selection in development and distribution profile (what we need here is development!), and then on the next screen select the app ID, device and certificate associated with the configuration file ( Game State Note: This is what you have set up in the previous step. Finally, name the configuration file and review the previous selections. When ready, click Generate. Now you can see your new profile, you need to download it to your desktop and install it. The configuration file will be a file with a. mobileprovision prefix.

Now turn to Xcode, go to Window > Organizer > Devices > Provisioning profile, and double-click the configuration file that has been downloaded to your desktop. You have finished the installation and are able to give the organizer view to see it. The final step is important because it works only if you install the configuration file to Xcode.

Some additional content: still in Xcode, if your device is still not visible in the Devices view, go to Window > Organizer > Devices and select the device by name. You may need to select Use for development in this process and then provide your developer record details.

Although this is a lengthy process, the good news is that you have finished your work!

Now you can start working on your Unity game and be ready to export it.

Remember that you can only register your device and create a developer certificate once, and every time you create a new game you need to create a brand new app ID and a new configuration file.

5. For unity

When you are ready to export your game, go to File > Build Settings and make sure you choose iOS as the platform. Remember to include the current scene into the export game (using the Add button). Then click on the Player Seetings button and go to other Settings.

Set the bundle identifier as you set it up (COM. Yourname.thegamename), you may need to set the target iOS version to 6 (or the version of your device). Keep everything as the default unless you have a reason to change them.

Then go back to build Settings window and click Build and keep the project in its own folder.

Connect your device and computer, open the folder and start the Xcode project. You'll see it open in Xcode. Select your device from the upper-left corner of the Xcode interface and click the Run button.

The project will give you the equipment to create and run automatically (make sure your device is turned on!)

That's it! Now your game is ready to run on your iOS device.

How to bring a game from unity to an iOS device

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.