Xcode 中的 iOS 配置文件编号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24353061/
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
iOS provisioning profile number in Xcode
提问by wcochran
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 列出这个数字。
回答by GayleDDS
What's being displayed in Xcode is the guaranteed to be unique UUID of the provisioning profile. To verify that it is the profile you want. Go to the Apple Developer "Certificates, Identifiers & Profiles" site.
Xcode 中显示的内容保证是配置文件的唯一 UUID。验证它是否是您想要的配置文件。转到 Apple 开发人员的“证书、标识符和配置文件”站点。
- 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. (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. Expired certificates are not a huge problem they do not affect your apps in the store. The apps people buy are signed by 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. You will have to distribute them all a new version with a new certificate and updated provisioning profile.
您可以在门户中创建新证书,但使用 Xcode 更容易。(我个人不会使用 Beta Xcode 6,以下所有屏幕截图均来自 Xcode 5.1)正如您所看到的,我的 Testflight 分发证书和配置文件已过期。过期的证书不是一个大问题,它们不会影响您在商店中的应用程序。人们购买的应用程序均由 Apple 签名。您必须签署该应用程序才能提交审核,以证明该应用程序来自您。如果证书在您审核期间过期,则可能会出现问题,但您需要做的就是重新提交。如果您的 Ad Hoc 分布式应用程序证书过期,那么您的 Beta 测试人员将无法再运行它。您将不得不使用新证书和更新的配置文件为它们分发一个新版本。
- 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 ? be patient
Success
这需要一些时间,~ 30 秒?要有耐心
成功
- 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. One thing missing, one incorrect permission, one bit changed and nothing works.
这只是安全性和私钥/公钥密码学。就像设置 ssh 密钥一样,细节决定成败。缺少一件事,一项不正确的权限,一点点更改,但没有任何效果。
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)
- Apple's Intermediate Certificate - The certificate identifying the signing authority required to validate your certificate
- A Provisioning Profile - containing
- An App ID
- Certificate
- List of Device ID's
- 您的私钥 - 需要签署对象,然后可以使用您的证书进行验证
- 您的 iPhone 证书(由 Apple 签名机构使用您的公钥创建)
- Apple 的中间证书 - 标识验证证书所需的签名机构的证书
- 配置文件 - 包含
- 应用程序 ID
- 证书
- 设备 ID 列表
The Requirements
要求
- Identify the developer
- Identify the iPhone Development Team (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
- 确定开发商
- 确定 iPhone 开发团队(Apple iOS Developer Membership)
- 确定应用程序
- 识别各个授权设备
- 确保用户设备上的应用程序的任何字节都没有改变
Common Issues:
常见问题:
- App ID in provisioning profile is not compatible with the Bundle Identifier defined in the application's info plist. Yes, it's unfortunate Xcode calls it a bundle identifier and the portal calls it an 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
- New machine: No developer account in Xcode so no Certificate and Provisioning Profile
- New machine: No private key for the Certificate
- When Xcode creates a Certificate for you. 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
- Download it from https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
- Certificate and/or Provisioning Profile Expired
- Keychain access not "Allow Always". Certificates are securely stored in the keychain so Xcode always needs keychain access
- 配置文件中的应用 ID 与应用信息 plist 中定义的捆绑标识符不兼容。是的,不幸的是 Xcode 将其称为包标识符,而门户将其称为 App ID。默认应用程序模板将包标识符链接到应用程序名称的变异版本,因此更改名称会破坏除模拟器之外的所有内容。请参阅:深入的团队配置文件 - https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/LaunchingYourApponDevices/LaunchingYourApponDevices.html#//apple_ref/doc/uid/TP40012582-CH27-SW10
- 新机器:Xcode 中没有开发人员帐户,因此没有证书和配置文件
- 新机器:证书没有私钥
- 当 Xcode 为您创建证书时。它首先创建一个私钥/公钥对。私钥保存在钥匙串中。证书签名请求被上传到苹果。您的证书是自动创建和下载的。您始终可以重新下载您的证书或配置文件,但您的私钥仅在您的钥匙串中,而且很可能仅在一台计算机上。除非您启用钥匙串同步或明确地将其保存到文件并将其通过网络连接到另一台机器。
- 新机:缺少 Apple 全球开发者关系证书颁发机构的中级证书
- 证书和/或配置文件已过期
- 钥匙串访问不是“始终允许”。证书安全地存储在钥匙串中,因此 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
回答by James Oltmans
This clue is buried in a comment by wcochranbut 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. (Brackets doesn't work for this reason).
您还可以在vim
不介意非 UTF-8 字符的其他文本编辑器中打开文件。(由于这个原因,括号不起作用)。
回答by Dave Wood
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. Another bonus is that it will show you the devices that are configured for that profile file.
这是一个 Quick Look 插件,可让您查看有关 .mobileprovision 配置文件的信息,包括其 UUID。另一个好处是它会向您显示为该配置文件配置的设备。