在多台计算机上进行 iOS 开发,在单个设备上进行测试,有什么建议吗?

发布于 2024-11-29 15:34:49 字数 240 浏览 3 评论 0原文

我正在寻找一些关于配置文件/证书等的建议...我在工作中使用 iMac 进行开发,有时我还发现自己在家里的 MacBook Pro 上从 git 检查代码,但我总是遇到问题我想从另一台电脑上测试我的 iPhone。

显然,我设备上的配置文件与工作中颁发给我的 iMac 的证书匹配,因此从我的笔记本电脑上,我无法在设备上进行测试,因为配置文件与证书不匹配。所以我收到代码签名错误。

我可以做什么来绕过这个?

提前致谢。

I was looking for some advice on provisioning profiles / certificates etc... I use an iMac at work to develop on, and I also sometimes find myself checking out my code from git onto my MacBook Pro at home but I always run into issues when I want to test on my iPhone from another computer.

Obviously my provisioning profiles on the device match the certificate issued to my iMac from work, so from my laptop, I can't test on the device because the provisioning profile doesn't match a certificate. so I get a code sign error.

What can I do to bypass this ?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

左岸枫 2024-12-06 15:34:49

Apple 提供了在多台机器上工作的简单解决方案。

您可以导出您的开发者资料您的工作 iMac 并将其移动到您的 Macbook Pro 上。

  1. 在 Xcode 4 中,调出管理器。单击“Devices”/

  2. 现在,单击侧边栏中的“开发者配置文件”。

  3. 然后,在屏幕底部您将看到一个名为“导出”的按钮和一个名为“导入”的按钮。在具有原始证书的计算机上单击“导出”并保存配置文件。系统可能会提示您输入密码。

  4. 在第二台计算机上,使用“导入”来安装证书。

导出开发人员配置文件

您现在应该能够在两台计算机之间无缝地进行开发和测试。

编辑:

根据Topher Fangio下面的评论,您可能需要:

打开钥匙串访问,然后在我的桌面上找到[您的]iPhone 开发者证书,并将其导出。然后将其导入到您的[第二台机器]上。如果您在一台计算机上看到下拉列表和关联的私钥,但在另一台计算机上看不到,那么您显然需要将其导出。

希望 Topher 的见解能够帮助任何在使用 Xcode 时遇到困难的人。

Apple provides an easy solution to working on multiple machines.

You can export your developer profile from your work iMac and move it onto your Macbook Pro.

  1. In Xcode 4, bring up the Organizer. Click on "Devices"/

  2. Now, click on "Developer Profiles" in the sidebar.

  3. Then, on the bottom of the screen you will see a button called "Export" and a button called "Import". On the computer with the original certificates click "export" and save the profile. You may be prompted to enter a password.

  4. On the second computer, use "import" to install the certificates.

Exporting a developer profile

You should be able to develop and test seamlessly between the two machines now.

Edit:

According to Topher Fangio in the comments below, you may need to:

open Keychain Access, then find [your] iPhone Developer Certificate on my desktop, and export it. Then import it on your [second machine]. If you see the dropdown and associated private key on one machine, but not the other, then you need to export it apparently.

Hopefully Topher's insight will help anyone who has trouble with using Xcode to do this.

若水般的淡然安静女子 2024-12-06 15:34:49

如果您使用的是 Xcode 6.x - 8.x,有一个非常简单的方法可以做到这一点:

请参阅 中标题为 导出和导入证书和配置文件 的部分。 href="https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html#//apple_ref/doc/uid/TP40012582-CH31-SW15" rel="nofollow noreferrer ">应用程序分发指南。

总结一下:

  1. 转到 Xcode 的首选项
  2. ,单击帐户,
  3. 单击在左下角的齿轮图标上
  4. 选择“导出帐户”并输入所需的文件名和密码,
  5. 在新计算机上打开新创建的文件

完成!这将从以前的机器导入配置文件。

If you're using Xcode 6.x - 8.x, there is a very easy way to do this:

See the section titled Exporting and Importing Certificates and Profiles in the app distribution guide.

To sum it up:

  1. go to Xcode's preferences
  2. click on accounts
  3. click on the gear icon at the bottom left
  4. select 'export accounts' and enter the desired filename and password
  5. open the newly created file on your new machine

Done! this will import the profiles from the previous machine.

℡Ms空城旧梦 2024-12-06 15:34:49

您需要保留您创建的原始私钥文件和证书文件,这是门户上该过程的绝对第一步。然后,您不仅需要在笔记本电脑上导入证书,还需要导入私钥文件。完成后,您应该能够在两台笔记本电脑上使用开发人员证书和配置文件进行签名。

我也遇到过这种情况。如果需要,您可以在配置门户上重新启动它,不会产生真正的负面影响。

You need to keep the original private key file and certificate file you create as the absolute first step in the process on the portal. Then you need to import not just the certificate but the private key file too on your laptop. Once that is done, you should be able to sign with your developer cert and provisioning profile on both laptops.

I've gotten in this situation too. You can start it all over on the provisioning portal if needed with no real negative effects.

一抹淡然 2024-12-06 15:34:49

我有 Xcode 4.6.1,在管理器中右下角现在有一个刷新按钮。点击该按钮,登录您的 Apple 帐户,它应该会提取所有相关的个人资料信息。

-干杯

I have Xcode 4.6.1 and in the organizer there is now a refresh button at the bottom right. Hit that, sign in to your Apple account and it should pull all the relevant profile info.

-Cheers

川水往事 2024-12-06 15:34:49

这个答案似乎不适用于 Xcode 4.6.3,其中组织者没有“开发人员配置文件”部分。

在 Xcode 5 和 6(大多数人将在发布时使用)中,有一个不同的过程,此处讨论

This answer does not seem to apply to Xcode 4.6.3 where the Organizer does not have a "Developer Profile" section.

In Xcode 5 and 6 (which most will be using at the time of posting) there is a different procedure which is discussed here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文