简体   繁体   English

尝试在iOS设备上运行应用程序时Xcode设置配置文件问题

[英]Xcode provisioning profile issues when trying to run applications on a iOS device

I'm following the excellent Stanford CS193P course (Fall 2011) on iTunes U: 我正在iTunes U上学习出色的Stanford CS193P课程(2011年秋季):
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/downloads-2011-fall http://www.stanford.edu/class/cs193p/cgi-bin/drupal/downloads-2011-fall

I'm trying to run my application (Calculator) from Xcode 4.2 with iOS 5 on my iPhone 3GS with iOS 4.3.3 我正在尝试在具有iOS 4.3.3的iPhone 3GS上从具有iOS 5的Xcode 4.2运行我的应用程序(计算器)

I followed those instructions: 我遵循了这些指示:
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/lectures/Developing%20on%20Devices.pdf http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/lectures/Developing%20on%20Devices.pdf

I was able to obtain my developer certificate with no problem. 我可以毫无问题地获得我的开发人员证书。

I went to the iOS Dev Center and created a provisioning profile. 我去了iOS开发中心并创建了一个配置文件。 I entered this in the form fields: 我在表单字段中输入以下内容:

  • Profile Name: I entered "Calculator" (does it matter?) 个人资料名称:我输入了“计算器”(这有关系吗?)
  • Certificates: I selected my name (only option since I created only one developer certificate) 证书:我选择了我的名字(由于我仅创建了一个开发者证书,因此是唯一的选择)
  • App ID: I selected "Calculator" (only option since I created only one App Id) 应用程序ID:我选择了“计算器”(由于仅创建了一个应用程序ID,因此是唯一选项)
  • Devices: I selected my device (only option since I created only one device) 设备:我选择了我的设备(由于仅创建了一个设备,因此只能选择)

I'm pretty sure I did the right thing for my certificate and for my device. 我很确定自己为证书和设备做了正确的事情。

For the App Id, I was a bit confused. 对于App ID,我有些困惑。

  • Description: I entered "Calculator" (again, does it matter?) 说明:我输入了“计算器”(同样,这有关系吗?)
  • Bundle Seed Id (App ID Prefix): It was displayed "Your Team Id xxxxxxx will be used as you App Id Prefix" (and I couldn't change it) 捆绑种子ID(应用ID前缀):显示为“您的团队ID xxxxxxx将与您的应用ID前缀一起使用”(但我无法更改)
  • Bundle Identifier (App ID Suffix): I entered "com.myname.calculator" 捆绑包标识符(应用程序ID后缀):我输入了“ com.myname.calculator”

Should a provisioning profile be made for one app (create a new one for each app I make) or for one developer (create only one for all the apps I make)? 应该为一个应用程序(为我制作的每个应用程序创建一个新的配置文件)还是为一个开发人员(为我制作的所有应用程序仅创建一个)创建一个配置文件?

When I finally completed my provisioning profile, I imported it in Organizer (in Xcode) and plugged in my iPhone and clicked on "Use for Development". 当我最终完成配置文件时,我将其导入了Organizer(使用Xcode)并插入了iPhone,然后单击“用于开发”。 I thought I was all done! 我以为我已经完成了!

However, when I try to run my application in Xcode using my connected device, I get the following error message: 但是,当我尝试使用连接的设备在Xcode中运行应用程序时,出现以下错误消息:

No provisioned iOS devices are available with a compatible iOS version. 没有可用的兼容iOS版本的预配置iOS设备。 Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination. 将iOS设备与最新版本的iOS连接,以运行您的应用程序或选择iOS模拟器作为目标。

Is it because I did something wrong with my provisioning profile? 是因为我的配置文件做错了吗? I searched around and my settings in Code Signing Identity and .plist seems to be OK. 我四处搜索,在“代码签名身份”和“ .plist”中的设置似乎还可以。

Or is it because my iPhone has iOS 4.3.3 and I'm trying to develop using iOS 5.0? 还是因为我的iPhone具有iOS 4.3.3,而我正在尝试使用iOS 5.0进行开发? That was the first thing I thought could be the problem, so I said, let's upgrade to 5.0. 那是我认为可能是问题的第一件事,所以我说,让我们升级到5.0。 However, it seems like I can only upgrade my iPhone to iOS 6.01, which I don't want to cause that iTunes U course is targeting iOS 5.0 and I know for sure some stuff won't work. 但是,似乎我只能将iPhone升级到iOS 6.01,我不想引起iTunes U课程的目标是iOS 5.0,并且我确定某些东西无法正常工作。 Is there a way to upgrade my iPhone to iOS 5.0 only? 有没有办法将我的iPhone仅升级到iOS 5.0?

Right now I'm trying to figure out where the problem actually is... my provisioning profile or my iPhone device? 现在,我正试图找出问题的实际出处...我的配置文件或iPhone设备?

EDIT #1: 编辑#1:

I started from scratch using a brand new application (I created a single-view application with a label "Hello World!" added to the view... nothing more). 我从头开始使用一个全新的应用程序(我创建了一个单视图应用程序,并在视图中添加了标签“ Hello World!”……仅此而已)。 I then created another provisioning profile from scratch by following this: 然后,我按照以下说明从头创建了另一个配置文件:
http://mobile.tutsplus.com/tutorials/iphone/iphone-sdk-install-apps-on-iphone-devices-for-development/ http://mobile.tutsplus.com/tutorials/iphone/iphone-sdk-install-apps-on-iphone-devices-for-development/

I still had the same error message. 我仍然有相同的错误信息。

I then went to the Build Settings of my new project and changed the iOS Deployment Target from iOS 5.0 to iOS 4.3... and then my application launched on my device! 然后,我转到新项目的“构建设置”,并将iOS部署目标从iOS 5.0更改为iOS 4.3 ...,然后在设备上启动了我的应用程序! However, the application didn't display my "Hello World!" 但是,该应用程序未显示我的“ Hello World!”。 label. 标签。

So it looks like I'm doing the right thing... but my device iOS is too old. 看来我在做正确的事...但是我的设备iOS太旧了。 I would like to upgrade it to iOS 5.0 but not iOS 6.01... is it possible? 我想将其升级到iOS 5.0,而不是iOS 6.01 ...可以吗?

EDIT #2: 编辑#2:

I upgraded my iPhone 3GS to iOS 6.01 and when I clicked on the "Use for Development" button in Organizer, I got this error message: 我将iPhone 3GS升级到iOS 6.01,并且在管理器中单击“用于开发”按钮时,出现以下错误消息:

The version of iOS on “My iPhone” does not match any of the versions of iOS supported for development with this installation of the iOS SDK. “我的iPhone”上的iOS版本与通过安装此iOS SDK开发所支持的所有iOS版本都不匹配。 Please restore the device to a version of the OS listed below, or update to the latest version of the iOS SDK; 请将该设备还原到下面列出的操作系统版本,或更新到最新版本的iOS SDK; which is available here. 在这里可用。

OS Installed on Gaston Vachon's iPhone 操作系统安装在Gaston Vachon的iPhone上
6.0.1 (10A523) 6.0.1(10A523)

Xcode Supported iOS Versions Latest Xcode支持的iOS版本最新
5.0 (9A334) 5.0(9A334)
4.3 4.3
4.2 (8C134) 4.2(8C134)
4.2 4.2

Now I would have to upgrade my Xcode to the latest version (4.5.2) but I can't since I'm using Snow Leopard. 现在,我必须将Xcode升级到最新版本(4.5.2),但由于使用Snow Leopard,所以我不能这样做。 So I would have to upgrade my Mac OS to either Lion or Mountain Lion then upgrade Xcode to 4.5.2 (iOS 6.01) and then It would probably work. 因此,我将不得不将Mac OS升级到Lion或Mountain Lion,然后将Xcode升级到4.5.2(iOS 6.01),然后它可能会工作。 However, since I'm following that iTunes U course done with Xcode 4.2 and iOS 5.0, I would rather wait to do those upgrades until I have completed this course. 但是,由于我遵循的是使用Xcode 4.2和iOS 5.0完成的iTunes U课程,因此我宁愿等待进行这些升级,直到完成本课程。

I guess I can't win! 我想我赢不了!

You also need to provision your device. 您还需要配置设备。 What this does is adds your device to the list of devices your app can actually run on while it is in development. 这样做是将您的设备添加到应用程序在开发过程中可以实际运行的设备列表中。

Here is Apples tutorial on how to provision devices. 这是有关如何配置设备的Apple教程。

http://developer.apple.com/library/ios/#recipes/xcode_help-devices_organizer/articles/provision_device_for_development-generic.html http://developer.apple.com/library/ios/#recipes/xcode_help-devices_organizer/articles/provision_device_for_development-generic.html

As for your other questions: 至于您的其他问题:

  • Profile name: Doesn't matter, just for your reference. 个人资料名称:没关系,仅供参考。
  • Description: Also just for your reference 说明:仅供参考
  • Bundle identifier: Has to match the bundle id in your app, you should also replace "myname" with your own name. 捆绑包标识符:必须与您应用中的捆绑包ID匹配,您还应该用自己的名称替换“ myname”。 It is meant to be for a website domain that you own. 它旨在用于您拥有的网站域。 For example my website is http://bentrengrove.com so one of my bundle identifiers is com.bentrengrove.WeightApp . 例如,我的网站是http://bentrengrove.com,因此我的捆绑包标识符之一是com.bentrengrove.WeightApp
  • Creating different profiles: You only need one generic development profile for all your apps. 创建不同的配置文件:所有应用程序仅需要一个通用开发配置文件。 You can use the bundle identifier with a wildcard. 您可以将包标识符与通配符一起使用。 Have a read of this note from Apple about when to create individual profiles vs generic profiles. 有一个读便条苹果何时创建个人档案,VS通用配置文件。

Pretty much all iOS5 code works on iOS6 and you should always develop with the latest SDK. 几乎所有iOS5代码都可以在iOS6上运行,并且您应该始终使用最新的SDK进行开发。 You can still deploy to devices that are running old iOS versions, you just have to make sure you are not using iOS6 only features. 您仍然可以将其部署到运行旧iOS版本的设备上,只需确保您未使用仅iOS6功能。

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

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