The getting started section of the manual gives a very clear step by step of the set up process.
- First thing you need to do is get an apple developer license
- Make sure you have the latest version of Mac OS (no windows version)
- Download the latest iphone SDK and install it
- Buy a copy of Unity iPhone Basic or Pro and install it
- Go the to the apple developer web site and click on the provisioning portal link
- Create and download your certification key
- Create a new App ID (com.yourCompany.yourGame)
- Add the UDID of your test phone to the device list
- Create a provisioning profile using your certificate key and App ID and all the devices you're gonna use for testing.
- Connect your phone to your mac and open xcode, click on organise and add the provisioning profile you just made
- Make your game in Unity
- Click on edit > player settings
- Input the App Id you made earlier (com.yourCompany.yourApp) without the unique string of letters and numbers Apple generates
- Set all the other settings like icons and display name and code stripping (leave this off if you're unsure) Generally leaving settings on default will be fine for debugging
- Click on build and run and unity will start compiling (and maybe compressing textures if you've set it which takes a while the first time)
- XCode will launch and compile the code. If there are no errors it'll also install it onto your phone and run it.
If you have additional xcode to add to the game you can do so before you press run in xcode (if you're using in-app purchasing you you'll need to activate it in the provisioning portal and also you need to import the storekit package)
If you get an error like "no phone connected with the correct certificate" it means you need to put the provisioning profile on the phone.
To test the app on other devices you need to add all the UDIDs of the devices to the provisioning profile and drag that and the compiled app into iTunes and sync the device.
Generally you don't need to alter settings in xcode if you're running a normal unity game but make sure you've selected the correct target OS you set in unity and also select run on device as unity doesn't support iphone simulator.
Jun 27 '10 at 03:11 PM