简体   繁体   English

构建iPhone应用程序时代码符号错误

[英]Code Sign Error When Building iPhone Application

I am new to iPhone development. 我是iPhone开发的新手。 I just registered with Apple for the iPhone Developer Program. 我刚刚在Apple注册了iPhone开发者计划。 When I try to build, I am receiving an error: 当我尝试构建时,我收到一个错误:

Code Sign error: a valid provisioning profile matching the application's identifier could not be found 代码签名错误:找不到与应用程序标识符匹配的有效供应配置文件

I'm not sure what is wrong. 我不确定是什么问题。 I tried browsing the Internet but I get confused. 我试过浏览互联网,但我感到困惑。 Can anyone help me with what I should do? 任何人都可以帮助我做我应该做的事情吗?

At first it seems a complex process, but it's pretty straightforward when you've been through it a few times. 起初看起来似乎是一个复杂的过程,但是当你经历了几次这样的过程时它非常简单。

In a nutshell the process is this: 简而言之,过程就是:

(I'm assuming you've set up your iPhone/iPod touch as a test device) (我假设您已将iPhone / iPod touch设置为测试设备)

Via the iPhone Developer Portal 通过iPhone Developer Portal

  1. Create an App ID (give your application a name, this is just for reference on the website and nothing to do with your own build of your application) enter a string to identify it, like com.yourcompany.appname (this is important and should be the same as in your .plist file inside Xcode) Click and Save this 创建一个App ID(给你的应用程序一个名字,这只是为了在网站上提供参考而与你自己的应用程序构建无关)输入一个字符串来识别它,比如com.yourcompany.appname(这很重要,应该与Xcode中的.plist文件相同)单击并保存

  2. Go to Provisioning There are 2 provisioning profiles you'll need a) development - so you can install your application on a test device (ie your iPhone / iPod touch) b) distribution - if you want to sell the application via the App Store 转到配置有2个配置文件,您需要a)开发 - 所以您可以在测试设备上安装您的应用程序(即您的iPhone / iPod touch)b)分发 - 如果您想通过App Store销售应用程序

    You can create the profiles by selecting your App ID, created in the previous step, from the drop down list and clicking Save In a few moments (usually, though it can be longer) the certificate is available for download. 您可以通过从下拉列表中选择上一步创建的应用程序ID并单击“保存”来创建配置文件。片刻(通常,虽然可能更长),证书可供下载。 Download this to your Mac and drop it onto the Xcode icon. 将其下载到Mac并将其放到Xcode图标上。 Sometimes the development profile doesn't work for me like this and I drop it directly into the Organiser window in Xcode that shows my connected device. 有时开发配置文件对我不起作用,我将它直接放入Xcode中显示我连接设备的管理器窗口。

    Besides, if you are in a team account, team admin need to edit Development Provisioning Profiles , and add modify your certificates privilege. 此外,如果您在团队帐户中,团队管理员需要编辑开发配置配置文件 ,并添加修改您的证书权限。

  3. In Xcode inside 'Edit Project Settings' you can select the certificate you wish to code sign with. 在“编辑项目设置”中的Xcode中,您可以选择要编码的证书。 Usually for debug I sign with the development certificate. 通常用于调试我签署开发证书。 Follow the instructions on the apple site and clone the release profile and call it something like release and sign this with your distribution profile. 按照Apple网站上的说明操作并克隆发布配置文件,并将其称为发布,并使用您的分发配置文件对其进行签名。 (You won't be able to load the app onto your phone with the distribution profile selected) (您将无法在选择了分发配置文件的情况下将应用加载到手机上)

  4. Make sure you select the target device as Device and not Simulator when building for the App Store! 在构建App Store时,请确保选择目标设备作为设备而不是模拟器!

Hope that helps, it's from memory so apologies if I've skipped some small steps. 希望有所帮助,如果我跳过了一些小步骤,那就是记忆中的道歉。

xcode左上角确保你正在运行“similator”“iphone”

Did you set up an iPhone provisioning profile for either development, ad hoc distribution, or app store distribution? 您是否为开发,临时分发或应用商店分发设置了iPhone配置文件?

If not go to the iPhone developer program portal, which is linked from the developer.apple.com/iphone . 如果没有,请转到从developer.apple.com/iphone链接的iPhone开发人员计划门户网站。 Apple has provided a great series of video tutorials. Apple提供了一系列精彩的视频教程。

As of July 2012, you can go here: 截至2012年7月,您可以到这里:

https://developer.apple.com/ios/manage/overview/index.action https://developer.apple.com/ios/manage/overview/index.action

Then launch the "Development Provisioning Assistant." 然后启动“开发配置助手”。 It walks through all the steps outlined by FiddleMeRagged. 它介绍了FiddleMeRagged概述的所有步骤。

You can use this process to create a Wildcard ID , if you're just looking to test your app on your iOS device and don't need to deploy to the App Store right away. 如果您只是想在iOS设备上测试应用程序而不需要立即部署到App Store,则可以使用此过程创建通配符ID

Just make sure you install the certificates or the profile won't be selectable in the project configuration. 只需确保安装证书,或者在项目配置中无法选择配置文件。 When you download the certificates double-click on them to install. 下载证书时,双击它们进行安装。

Possibly more use for others seeing this issue on a previously configured dev environment. 可能更多地用于在先前配置的开发环境中看到此问题的其他人。

This error is also shown if your provisioning profile has expired, in this case you can go through the steps in Neosionnach's answer or you can go to Organizer, click on the profile and click Refresh. 如果您的配置文件已过期,也会显示此错误,在这种情况下,您可以完成Neosionnach答案中的步骤,也可以转到管理器,单击配置文件并单击“刷新”。

This was the winner for me when I had this issue. 当我遇到这个问题时,这是我的赢家。

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

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