How to use device instead of Simulator
I am a new with iphone development and want to test my application on my iphone . I have paid $100 but can not find any way to workout how to do that . There are some references around but 开发者_C百科they are for xcode 3.
Any help would be much appreciated.
First you have to get your developer certificate/keys set up on your mac. See the developer portal where there are detailed instructions on how to get this set up.
Once you have your certificate, plug in your device, and press cmd + shift + 2 in XCode - to load up the organizer. Select the devices pane, click on your device, and click the 'use for development' button. It will ask you to put your username/password in for your dev account, and then it will enable your device for development. After it has been enabled, you simply select it as the target to build to in the top-left of the main Xcode window.
I know this question has been answered already, but I have had a lot of hair pulling trying to get XCode4 to install directly to my device. Heaven help you if you are trying to get multiple machines to install to the same device.
My best advice, let XCode4 do all the work for you. Trying to manually configure your certificates will only lead you to bashing your computer or device to smithereens.
If you get stuck, or only get half of it working, follow these steps.
- Delete all of your certificates from Keychain. You can leave the Apple Dev certificate, but everything else must go.
- Set your project to No Code Signing for everything. If you have any old provisioning profiles you've used, you don't want your project looking at anything.
- In Organizer, delete any provisioning profiles you have there. For XCode4 as well as your device.
- I usually close my project, but this could be an option step.
- Delete your developer certificate in the Apple Developer Portal. It will complain, but too bad.
- DO NOT DELETE ANY PROVISIONING PROFILES ON THE WEBSITE. You'll need these later. They should all be configured already to your devices and testing team. They are fine.
- Open Organizer and under Provisioning Profiles there should be the Import button and check box to let XCode4 do the work for you. Use that button to let XCode set it all up.
- It should tell you that you don't have a developer certificate and auto request one, let XCode request it. It will probably prompt you for your developer credentials at some point.
- It will take a few seconds, but it should pull in any Provisioning Profiles associated with your account, create the developer certificate in your keychain, and if your device is plugged in, copy the most current provisioning profile to your device.
- Open your project, select iPhone Developer for your build. If it is blank, select it anyway, it should associate with the correct profile for running.
- Run your build with your device selected and you should be good to go.
I had a terrible run of trial and error to get these working as I was working between the normal Xcode and the beta build. I don't wish code signing issues on my worst enemy. Hopefully this will work for you and anyone else that runs into issues with it. Good luck!
精彩评论