Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
140 views
in Technique[技术] by (71.8m points)

ios - Provisioning New Device for Development Xcode

I am a new iOS developer, and although I have been successful in provisioning a device for development in Xcode in the past, I just obtained a new device and am having an awful time getting Xcode to provision it and allow me to test applications on it.

When I connect the new device to Xcode, Xcode does recognize and identify the device correctly, however when I run the application I get the following error message: "A valid provisioning profile for this executable was not found."

According to the Apple documentation, I am supposed to first request a development certificate in Xcode using the following steps:

  1. Choose Window > Organizer > Devices
  2. Select Provisioning Profiles.
  3. Click the Refresh button at the bottom of the window.
  4. Enter your user name and password and click Log in.
  5. After you sign in to your account, a prompt appears, asking whether Xcode should request your development certificate.

I have followed steps 1 - 4 repeatedly and each and every time Xcode crashes before I can get to step 5. I have tried completely closing xcode, detaching device, cleaning project, restarting computer, etc. Is there another way to request a development certificate outside of Xcode?

Ok so then the docs say I should provision the device (granted I assume this step is contingent upon the success of the previous step which I cannot achieve, but I tried it anyway) using the following steps:

  1. Connect your device to your Mac.
  2. Open the Devices organizer
  3. select your iOS device.
  4. Click the “Use for Development” button. The first time you add a device ID to your account, Xcode creates the iOS Team Provisioning Profile using the iOS Wildcard App ID, your development certificate, and the device ID. The iOS Team Provisioning Profile is also installed on your iOS device. If the device was used for development in the past, the “Use for Development” button may not appear. If this happens, click “Add to Portal” at the bottom of the screen instead.

So the "use for development" button does not appear (it appeared the first time I attempted this and hasn't since), so I clicked the "add to portal button". Every single time I do this, Xcode crashes.

I currently have the code signing identity set to iPhone Developer (my name). I have also tried setting it just to iPhone Developer and even Do Not Code Sign. I also went to the iOS dev center and added the device there (not sure if I needed to do that or not).

In any case, can anyone suggest anything I might be missing or any other approach?

question from:https://stackoverflow.com/questions/15883914/provisioning-new-device-for-development-xcode

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I also went to the iOS dev center and added the device there (not sure if I needed to do that or not).

You need to add the device there.

Steps You need to follow after adding device:

  1. Next re-download the mobile provisioning profile again.

  2. Go to organizer and delete the old mobile provisioning profile you had.

  3. Double click the new mobile provisioning profile you just downloaded and see that it appears on the organizer.

  4. Connect your device and you should see your device's name instead of iOS device.

hope this helps.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...