简体   繁体   English

Xcode 中的 iOS 配置文件编号

[英]iOS provisioning profile number in Xcode

Anyway to match the provisioning profile in Xcode's organizer or online developer site with the crazy serial/id number given under Xcode's code signing preferences?无论如何要将 Xcode 的组织者或在线开发人员站点中的配置文件与 Xcode 代码签名首选项下给出的疯狂序列号/ID 号相匹配?

在此处输入图片说明

I want to make double sure I am building my app with the correct (Ad Hoc) provisioning profile -- Xcode gives me a long ID (as seen above), but the online developer site and the Xcode preferences that list my provisioning profiles don't list this number.我想确保我使用正确的 (Ad Hoc) 配置文件构建我的应用程序——Xcode 给了我一个长 ID(如上所示),但在线开发人员站点和列出我的配置文件的 Xcode 首选项没有“ t 列出这个数字。

What's being displayed in Xcode is the guaranteed to be unique UUID of the provisioning profile. Xcode 中显示的内容保证是配置文件的唯一 UUID。 To verify that it is the profile you want.验证它是否是您想要的配置文件。 Go to the Apple Developer "Certificates, Identifiers & Profiles" site.转到 Apple Developer“证书、标识符和配置文件”站点。

  • Look at the code signing detail to get the name of the provisioning profile查看代码签名详细信息以获取配置文件的名称

代码签名细节

代码签名细节放大

下载配置文件

  • Download the provisioning profile you think it should be下载您认为应该是的配置文件
  • Peek inside the provisioning profile file using ether the command line or a plain text editor.使用以太网命令行或纯文本编辑器查看配置文件的内部。 Do not use Xcode (Personally I just, drag and drop the file into TextMate 2)不要使用 Xcode (我个人只是将文件拖放到 TextMate 2 中)

在此处输入图片说明

  • Compare the UUID in the file and your setting in Xcode比较文件中的 UUID 和您在 Xcode 中的设置

FYI: Provisioning profiles and development certificates die.仅供参考:配置文件和开发证书已失效。

You can create new certificates in the the portal but it is way easer to use Xcode.您可以在门户中创建新证书,但使用 Xcode 更容易。 (I personally would not use the Beta Xcode 6 and all the following screenshots are from Xcode 5.1) As you can see my Testflight distribution certificate and provisioning profile have expired. (我个人不会使用 Beta Xcode 6,以下所有屏幕截图均来自 Xcode 5.1)正如您所看到的,我的 Testflight 分发证书和配置文件已过期。 Expired certificates are not a huge problem they do not affect your apps in the store.过期的证书不是一个大问题,它们不会影响您在商店中的应用程序。 The apps people buy are signed by Apple.人们购买的应用程序均由 Apple 签名。 You have to sign the app to submit it for review to prove the app came from you.您必须签署该应用程序才能提交审核,以证明该应用程序来自您。 It could be a problem if the certificate expires while your in review, but all you need to do is resubmit.如果证书在您审核期间过期,则可能会出现问题,但您需要做的就是重新提交。 If your Ad Hoc distributed app certificate expires then your beta testers will no longer be able to run it.如果您的 Ad Hoc 分布式应用程序证书过期,那么您的 Beta 测试人员将无法再运行它。 You will have to distribute them all a new version with a new certificate and updated provisioning profile.您将不得不使用新证书和更新的配置文件为它们分发一个新版本。

  • Use Xcode to update Distribution Certificate - Xcode - Preferences - Accounts Tab - Select Account - "View Details ..." button使用 Xcode 更新分发证书 - Xcode - 首选项 - 帐户选项卡 - 选择帐户 - “查看详细信息...”按钮

在此处输入图片说明

  • Add new distribution certificate添加新的分发证书

在此处输入图片说明

  • This will take some time, ~ 30 sec ?这需要一些时间,~ 30 秒? be patient要有耐心

  • Success成功

在此处输入图片说明

  • You can now use the portal to edit or create a new provisioning profile and completely control who can access your Ad Hoc Distributed App您现在可以使用门户来编辑或创建新的配置文件,并完全控制谁可以访问您的 Ad Hoc Distributed App

Certificates and Provisioning Profiles Explained证书和配置文件说明

It's just security and private key/public key cryptography.这只是安全性和私钥/公钥密码学。 Like setting up ssh keys the devil is in the details.就像设置 ssh 密钥一样,细节决定成败。 One thing missing, one incorrect permission, one bit changed and nothing works.缺少一件事,一项不正确的权限,一点点更改,但没有任何效果。

供应配置文件图

The Players玩家们

  • Your private key - Required to sign objects that can then be validated with your certificate您的私钥 - 需要签署对象,然后可以使用您的证书进行验证
  • Your iPhone Certificate (Created by Apple the signing authority using your public key)您的 iPhone 证书(由 Apple 签名机构使用您的公钥创建)
  • Apple's Intermediate Certificate - The certificate identifying the signing authority required to validate your certificate Apple 的中间证书 - 标识验证证书所需的签名机构的证书
  • A Provisioning Profile - containing配置文件 - 包含
    • An App ID应用程序 ID
    • Certificate证书
    • List of Device ID's设备 ID 列表

The Requirements要求

  • Identify the developer确定开发商
  • Identify the iPhone Development Team (Apple iOS Developer Membership)确定 iPhone 开发团队(Apple iOS Developer Membership)
  • Identify the application确定应用程序
  • Identify the individual authorized devices识别各个授权设备
  • Ensure not a single byte of the application has changed on the user's device确保用户设备上的应用程序的任何字节都没有改变

Common Issues:常见问题:

  • App ID in provisioning profile is not compatible with the Bundle Identifier defined in the application's info plist.配置文件中的应用 ID 与应用信息 plist 中定义的捆绑标识符不兼容。 Yes, it's unfortunate Xcode calls it a bundle identifier and the portal calls it an App ID.是的,不幸的是 Xcode 将其称为包标识符,而门户将其称为 App ID。 The default app templates link the bundle identifier to a mutated version of the app name so changing the name breaks everything but the simulator.默认应用程序模板将包标识符链接到应用程序名称的变异版本,因此更改名称会破坏除模拟器之外的所有内容。 See: Team Provisioning Profiles in Depth - https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/LaunchingYourApponDevices/LaunchingYourApponDevices.html#//apple_ref/doc/uid/TP40012582-CH27-SW10请参阅:深入的团队配置文件 - https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/LaunchingYourApponDevices/LaunchingYourApponDevices.html#//apple_ref/doc/uid/TP40012582-CH27-SW10
  • New machine: No developer account in Xcode so no Certificate and Provisioning Profile新机器:Xcode 中没有开发人员帐户,因此没有证书和配置文件
  • New machine: No private key for the Certificate新机器:证书没有私钥
    • When Xcode creates a Certificate for you.当 Xcode 为您创建证书时。 It first creates a private key / public key pair.它首先创建一个私钥/公钥对。 The private key is saved in the keychain.私钥保存在钥匙串中。 A certificate signing request is uploaded to apple.证书签名请求被上传到苹果。 Your Certificate is created and downloaded automatically.您的证书是自动创建和下载的。 You can always re-download your certificate or provisioning profile but your private key is only in your keychain and more then likely only on one computer.您始终可以重新下载您的证书或配置文件,但您的私钥仅在您的钥匙串中,而且很可能仅在一台计算机上。 Unless you enable keychain syncing or explicitly save it to a file and sneaker-net it to another machine.除非您启用钥匙串同步或明确地将其保存到文件并将其通过网络连接到另一台机器。
  • New machine: Missing Intermediate Certificate from Apple's Worldwide Developer Relations Certificate Authority新机:缺少来自 Apple 全球开发者关系证书颁发机构的中级证书
  • Certificate and/or Provisioning Profile Expired证书和/或配置文件已过期
  • Keychain access not "Allow Always".钥匙串访问不是“始终允许”。 Certificates are securely stored in the keychain so Xcode always needs keychain access证书安全地存储在钥匙串中,因此 Xcode 始终需要钥匙串访问

Reference: Apple's Application Distribution Guide - https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AppDistributionGuide.pdf参考:Apple 的应用程序分发指南 - https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AppDistributionGuide.pdf

This clue is buried in a comment by wcochran but if all you need is to view the UUID of the mobileprovision file run this:这条线索隐藏在wcochran的评论中,但如果您只需要查看 mobileprovision 文件的 UUID,请运行以下命令:

grep -a -A 1 'UUID' <PATH_TO_MOBILEPROVISION_FILE>

That will print something like:这将打印如下内容:

<key>UUID></key>
<string>1a1a1a1a-2b2b-3c3c-4d4d-5e5e5e5e5e5e</string>

With the value between the <string> tags being the UUID you need. <string>标记之间的值是您需要的 UUID。

You can also open the file in vim or some other text editor that doesn't mind non UTF-8 chars.您还可以在vim或其他不介意非 UTF-8 字符的文本编辑器中打开该文件。 (Brackets doesn't work for this reason). (由于这个原因,括号不起作用)。

This is a very handy tool: https://github.com/chockenberry/Provisioning这是一个非常方便的工具: https : //github.com/chockenberry/Provisioning

It's a Quick Look plug-in that lets you view the info about a .mobileprovision profile file, including its UUID.这是一个 Quick Look 插件,可让您查看有关 .mobileprovision 配置文件的信息,包括其 UUID。 Another bonus is that it will show you the devices that are configured for that profile file.另一个好处是它会显示为该配置文件配置的设备。

I couldnt find a Windows answer anywhere, so here it is:我在任何地方都找不到 Windows 答案,所以这里是:

If you using windows, you can just open the downloaded provisioning profile with a text editor (I used Notepad++) to identify privisioning profile's UUID如果您使用 Windows,则只需使用文本编辑器(我使用 Notepad++)打开下载的配置文件即可识别配置文件的 UUID

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM