ios XCode 4 - 设备未显示在架构“目标”下拉列表中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5888687/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 19:49:07  来源:igfitidea点击:

XCode 4 - Device does not show up in the schema "destination" dropdown

iphoneiosxcode4

提问by npellow

I can't for the life of me find out how to run applicaitons on a device (specifically, and iPhone 4) using XCode 4.

我一生都无法了解如何使用 XCode 4 在设备(特别是 iPhone 4)上运行应用程序。

The documentation says to "Set the run destination to iOS device in the scheme editor and build and run your application."

该文档说“在方案编辑器中将运行目标设置为 iOS 设备并构建和运行您的应用程序。”

The dropdown menu in the schema editor only has simulator options.

模式编辑器中的下拉菜单只有模拟器选项。

Could someone present a step-by-step method for running applications on devices using Xcode 4?

有人可以介绍在使用 Xcode 4 的设备上运行应用程序的分步方法吗?

Using: Xcode 4.0.2 (iOS 4.3) iPhone 4.3.3

使用:Xcode 4.0.2 (iOS 4.3) iPhone 4.3.3

UPDATE

更新

I ended up doing a series of restarts (Macbook Pro, iPhone 4, Xcode), did a few cleans and builds of the project, and set the "Base SDK" build attribute for the TARGET to "Latest iOS (iOS 4.3).

我最终进行了一系列重新启动(Macbook Pro、iPhone 4、Xcode),对项目进行了一些清理和构建,并将 TARGET 的“Base SDK”构建属性设置为“Latest iOS (iOS 4.3)”。

After that, the device appeared in the destination drop-down in the scheme editing menu.

之后,该设备出现在方案编辑菜单的目的地下拉菜单中。

(Thank you for your time septi!)

(谢谢你的时间 septi!)

回答by npellow

Be sure to Verify the BASE SDKused in your project. From the docs:

请务必验证项目中使用的 BASE SDK。从文档:

" Note: If you are building to your development device, the Base SDK version number defined on your Xcode project must be greater than or equal to the software version number on your development device; otherwise Xcode cannot initiate a debugging session with the device. In that case, you will need to download and install the latest iOS SDK version that is greater than or equal to your device software version. "

" 注意:如果您要构建到开发设备,则 Xcode 项目上定义的 Base SDK 版本号必须大于或等于开发设备上的软件版本号;否则 Xcode 无法启动与设备的调试会话。在这种情况下,您将需要下载并安装大于或等于您的设备软件版本的最新 iOS SDK 版本。”

回答by Tereus Scott

I had a similar problem. My phone has iOS 4.2.1

我有一个类似的问题。我的手机有 iOS 4.2.1

I downloaded a sample app and my phone did not show up as an option, only the simulators were listed.

我下载了一个示例应用程序,但我的手机没有显示为选项,只列出了模拟器。

So this is just a configuration issue:

所以这只是一个配置问题:

To fix this you need to select the project, and:

要解决此问题,您需要选择项目,并且:

  1. (as noted above) Select Build Settings/Base SDK = (in my case) Latest iOS (iOS 4.3)
  2. Select Summary: Devices: iPhone
  3. Select Deployment Target: (in my case) 4.2
  1. (如上所述)选择构建设置/基础 SDK =(在我的情况下)最新的 iOS (iOS 4.3)
  2. 选择摘要:设备:iPhone
  3. 选择部署目标:(在我的情况下)4.2

Now I get the following in the dropdown list of targets:

现在我在目标下拉列表中得到以下内容:

Myiphone (4.2.1, overriding Base SDK to 4.3)

Myiphone(4.2.1,将 Base SDK 覆盖到 4.3)

回答by Paul de Lange

Also watch out for the UIRequiredDeviceCapabilities property in the plist file. This can prevent a device from showing up sometimes.

还要注意 plist 文件中的 UIRequiredDeviceCapabilities 属性。这可以防止设备有时出现。

回答by Danny

I encountered this today in XCode 5 and tried the steps specified. Eventually, I found another solution that may be of use to future readers (Xcode 4 or otherwise).

我今天在 XCode 5 中遇到了这个问题,并尝试了指定的步骤。最终,我找到了另一个可能对未来读者有用的解决方案(Xcode 4 或其他版本)。

  1. Go to your project settings and select your target.
  2. Select the "General" tab and scroll to Deployment Info.
  3. Under "Deployment Target", make sure that your device's OS, or something lower, is specified.
  4. ---> Your device should now show up as available for debugging in the listing.
  1. 转到您的项目设置并选择您的目标。
  2. 选择“常规”选项卡并滚动到部署信息。
  3. 在“部署目标”下,确保指定了您设备的操作系统或更低版本。
  4. ---> 您的设备现在应该在列表中显示为可用于调试。

Came across this by checking the same device in another project. In that project, the device was listed just fine. When looking at the project settings between the two, the above difference was what stuck out and resolved the issue.

通过检查另一个项目中的相同设备发现了这一点。在那个项目中,该设备被很好地列出。在查看两者之间的项目设置时,上述差异是突出并解决问题的原因。

回答by Zanzi

The "Deployment Target" in the project general settings needs to be <= your device, as Danny said above.

项目常规设置中的“部署目标”需要 <= 您的设备,正如 Danny 上面所说。

Be aware that when you create a new project in a new version of XCode, the default deployment target will be the latest OS release. If your iPhone is on a lower release, this means you either need to upgrade your iPhone, or install an older SDK into your XCode.

请注意,当您在新版本的 XCode 中创建新项目时,默认部署目标将是最新的操作系统版本。如果您的 iPhone 版本较低,这意味着您需要升级您的 iPhone,或者将旧版 SDK 安装到您的 XCode 中。

You can install an older SDK by copying it into the XCode package at location:

您可以通过将旧版 SDK 复制到以下位置的 XCode 包中来安装它:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs