How to bring the game from unity to the iphone device

Source: Internet
Author: User
Tags unique id
When I started developing my own iOS game, the first thing I thought about was how to export it to the device and test my game so effectively. Initially, the process seemed long and complex, and the main problem I encountered was that although there were many resources, they were not entirely from the same place, so I had to mix and match them through a variety of tutorials. So I decided to make a step-by-step summary of this process through this article. This is some of the ways I've followed so far, and hopefully it will be more helpful to people at the same stage of development.
Let's get started.

Develoers (from Apple)
   1. Get Unity and iOS exporter
If you have not done so, you first need to download the latest version of Unity on the website. There are 2 versions, the free version (Http://unity3d.com/unity/download) and the Pro version (https://store.unity3d.com), so you can make a choice based on your needs. Since May 2013, the phone has its own exporter, so you don't have to pay for them any more.
   2. Registered Apple Developer program
The next thing you need to do is join the Apple Developer program, which is the necessary process for setting up your development credentials. To join the program, you'll need to pay 99 dollars a year, and you will need to register through the following developer website: https://developer.apple.com/programs/ios/(once you have completed the registration and paid the fee, You will receive an activation email to help you join the program and enable you to use all of the features you need.
   3. Download and install Xcode
The next thing you do when you join a developer program is to download and install Xcode. This may be confusing at first, and some of you will know that Xcode is the user who creates native apps for iOS. and unity using Xcode as an intermediary will be content in iOS devices, so you do not really enter the Xcode, all the development will occur in unity, Xcode role is to import content from unity into the device. You can download xcode:https://developer.apple.com/xcode/from the Apple Store. When you are finished downloading, make sure that you install it before proceeding to the next step.
   4. Create a developer configuration file
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 transplant the game you developed or any test to your device). Apple provides two types of configuration files, the developer profile for development and testing, and the distribution profile to be submitted to the Apple store. To create a developer profile, you need to do 3 things: Register your device/build an application Id/get a certificate.
You can do these three things through your Apple developer program. So navigate to this address: https://developer.apple.com/, and then enter the member Center from the top menu. Log in using your Apple ID and password.
Now select certificates, identifiers and profiles, and you will be able to access and manage your profile, Apple IDs, and so on.
   1 Registration of your equipment
Select the device in the certificates, identifiers, and Profiles sections. Because it is necessary for Apple to identify specific devices for testing. This does not change any of your device settings, 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 (that is, the device's unique ID). 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 (like an iphone and an ipad).
To find the udid of your device, you need to connect your device to your computer, and then open itunes and click on the iphone button (at the top right of the interface) and you'll see the device's information contains the name. Then you can stop the mouse over and click Serial number, which will become a regular logo, this is udid.
This is the number you need, and you have to paste it into the ID section of the Member Center portal. Now you can sign up for your device. Remember that once you register the device, you can only change its name and not change the udid.
   2) set an application ID
The next step is to set your application ID. Still in the certificates, identifiers and profiles of the member Center portal, select the application ID and click the key.
Give any description you want first, as long as it helps you remember what your ID is for. A good way to do this is to use a unique name for an application and use a common name for a test application. Next you need to set the bundle Identifier, which is presented in the opposite field notation.
Namely: 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 game you play. This is useful, however, to enable you to access services such as "Gaming Center" and "application internal purchase".
On the other hand, wildcard's bundle ID is rendered in the following form:
Com. Yourname.*
This replaces the name of the game with an asterisk. This format allows you to use the same ID in a variety of applications 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 application ID. Record the bundle ID, as you will need to use it in the Unity build setup.
   3 Obtain the developer certificate
The first thing you need to do is get certificate signing Request through 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 the preference is closed. Now go to Certificate Assistant in Keychane access and select Request authority from certificate certificate. Provide the same details you used to register the developer program and click Continue. Provide a name and save it to desktop. Select 2048-bit body and RSA at save time.
Now you should have a file with the. certsigningrequest prefix in your desktop.
Now go back to the certificates, identifiers, and Profiles sections of the member Center portal, choose Certificates > Development (as you would for a development certificate), and then press Press the key to create.
Choose to upload the certificate signing Request you saved in desktop. Before you submit, make sure to scroll down the page and find WWDR certificate in the intermediate certificates. You can download it when you need it later.
Now submit, your certificate signing request will be sent to Apple and replaced by another content that 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're ready to set up your developer certificate.
   4) Create the configuration file
After completing the three steps above, you can now continue to create the configuration file. Still in the certificates, identifiers and Profiles of the member Center portal, go to provisioning Profiles > All and press the keys to create a new profile.
Make a choice in the development and distribution profile (here we need development!) and then select the application ID, device, and certificate associated with the configuration file on the next screen ( Game Bang Note: This is what you've already set up in the previous steps. 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 the. mobileprovision prefix.
Now turn to Xcode, go to Window > Organizer > Devices > Provisioning Profile, and then double-click the configuration file that has been downloaded to your desktop. You then complete the installation and can give organizer view to see it. The final step is important because it works only if the configuration file is installed 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 choose use for Development in this process and then provide details of your developer record.
Although this is a long process, the good news is that you have finished your work! Now you can start working on your Unity game and get ready to export it.
Remember that you can only register equipment and create a developer certificate once, whenever you create a new game you need to create a brand-new application ID and new configuration file.
   5. Facing Unity
When you are ready to export your game, go to the file > Build Settings and make sure you choose iOS as a platform. Remember to include the current scene in the export game (using the Add present key). Then click the Player Seetings button and go to the other Settings.
Set the bundle identifier according to the settings you previously set up (COM. Yourname.thegamename), you may need to set the target iOS version to 6 (or your device version). Keep everything as default unless you have a reason to change them.
Then go back to the Build Settings window and click Build and keep the item in its own folder.
Connect your device and computer, open the folder and start the Xcode project. You will see it open in the Xcode. Select your device from the upper-left corner of the Xcode interface and click the Run button.
The project will give your device to be created and run automatically (make sure your device is open!)
That's it! Now your game has been able to run on your 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.