ios 为开发 Xcode 配置新设备

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15883914/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 23:06:53  来源:igfitidea点击:

Provisioning New Device for Development Xcode

iosxcodeios-provisioning

提问by jac300

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.

我是一名新的 iOS 开发人员,虽然我过去在 Xcode 中成功配置了用于开发的设备,但我刚刚获得了一个新设备,并且很难让 Xcode 配置它并允许我在其上测试应用程序.

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."

当我将新设备连接到 Xcode 时,Xcode 确实可以正确识别和识别设备,但是当我运行应用程序时,我收到以下错误消息:“找不到此可执行文件的有效配置文件。”

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

根据 Apple 文档,我应该首先使用以下步骤在 Xcode 中请求开发证书:

  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.
  1. 选择“窗口”>“管理器”>“设备”
  2. 选择供应配置文件。
  3. 单击窗口底部的刷新按钮。
  4. 输入您的用户名和密码,然后单击登录。
  5. 登录帐户后,会出现一个提示,询问 Xcode 是否应请求您的开发证书。

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?

我重复执行步骤 1 - 4,每次 Xcode 崩溃后,我才能进入步骤 5。我尝试过完全关闭 xcode、分离设备、清理项目、重新启动计算机等。还有另一种方法来申请开发证书吗?在 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.
  1. 将您的设备连接到 Mac。
  2. 打开设备管理器
  3. 选择您的 iOS 设备。
  4. 单击“用于开发”按钮。首次向帐户添加设备 ID 时,Xcode 会使用 iOS 通配符应用 ID、您的开发证书和设备 ID 创建 iOS 团队配置文件。iOS 团队供应配置文件也安装在您的 iOS 设备上。如果设备过去用于开发,则“用于开发”按钮可能不会出现。如果发生这种情况,请单击屏幕底部的“添加到门户”。

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.

所以“用于开发”按钮没有出现(它出现在我第一次尝试这个并且没有出现过),所以我点击了“添加到门户按钮”。每次我这样做时,Xcode 都会崩溃。

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).

我目前将代码签名身份设置为 iPhone Developer(我的名字)。我还尝试将其设置为 iPhone Developer 甚至 Do Not Code Sign。我还去了 iOS 开发中心并在那里添加了设备(不确定是否需要这样做)。

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

无论如何,有人可以建议我可能遗漏的任何内容或任何其他方法吗?

采纳答案by lakesh

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

我还去了 iOS 开发中心并在那里添加了设备(不确定是否需要这样做)。

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.

  1. 接下来再次重新下载移动配置文件。

  2. 转到管理器并删除您拥有的旧移动配置文件。

  3. 双击您刚刚下载的新移动配置文件,并看到它出现在管理器上。

  4. 连接您的设备,您应该会看到您的设备名称,而不是 iOS 设备。

hope this helps.

希望这可以帮助。

回答by matt

While I was sleeping, Apple completely abolished the Portal and created a new and apparently largely broken interface. It's like a kind of evil April Fools joke. Anyway, if you go to https://developer.apple.com/account/ios/device/deviceList.actionthere's a great big sign telling you that you must "reset your device list before adding any new devices". That sounds like it covers exactly your case. Good luck.

在我睡觉的时候,Apple 彻底废除了 Portal 并创建了一个新的但明显已经损坏的界面。这就像一个邪恶的愚人节玩笑。无论如何,如果你去https://developer.apple.com/account/ios/device/deviceList.action有一个很大的标志告诉你你必须“在添加任何新设备之前重置你的设备列表”。听起来它完全涵盖了您的情况。祝你好运。

enter image description here

在此处输入图片说明

回答by dhahn

If you are looking to bypass the 'Register a Device' portion of the Provisional Profile registration simply upload the 'sample .txt file' they provide you and upload it. You will then be allowed to click 'Next' to finish the registration so this way you do not have to enter a device UID.

如果您希望绕过临时配置文件注册的“注册设备”部分,只需上传他们为您提供的“示例 .txt 文件”并上传即可。然后您将被允许单击“下一步”完成注册,这样您就不必输入设备 UID。