xcode 错误:选定的运行目标对于此操作无效

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

xcode error: The selected run destination is not valid for this action

iphonexcodeios

提问by Alessio Lunardelli

my app in 4.3 simulator and device work well. Now i want to test it in 4.0 simulator and i have also 4.2.1 device. So i set ios deployment target to 4.0 (tried also 4.2), but xcode give me that error :The selected run destination is not valid for this action.

我的应用程序在 4.3 模拟器和设备中运行良好。现在我想在 4.0 模拟器中测试它,我也有 4.2.1 设备。所以我将 ios 部署目标设置为 4.0(也尝试了 4.2),但是 xcode 给了我这个错误:所选的运行目标对于此操作无效。

Then i added my second iphone to provisioning profile and i see it in device in xcode for build but same thing: The selected run destination is not valid for this action.

然后我将我的第二个 iphone 添加到配置文件中,我在 xcode 的设备中看到它进行构建,但同样的事情:所选的运行目标对于此操作无效。

How can i read (or if one can explain me) where to find how to setup project for run in 4.0 4.2 and 4.3 simulator for example?

例如,我如何阅读(或者如果有人可以解释我)在哪里可以找到如何设置项目以在 4.0 4.2 和 4.3 模拟器中运行?

I'm trying to "click everywhere" also in manage schemes but can't find nothing usefull.

我也在管理方案中尝试“到处点击”,但找不到任何有用的东西。

Thx in advice.

谢谢你的建议。

回答by Ante Barac

You need to set the iOS Deployment Target on both the Project and the Target items. When you click the project icon in the Project navigator, on the left side you will se two groups, Project and Targets. Project will contain your project, and the Targets section will have your app and unit test targets. Set the iOS Deployment on your project settings and in the target (app, not tests) settings.

您需要在 Project 和 Target 项上设置 iOS 部署目标。当您单击项目导航器中的项目图标时,您将在左侧看到两个组,项目和目标。Project 将包含您的项目,Targets 部分将包含您的应用程序和单元测试目标。在您的项目设置和目标(应用程序,而不是测试)设置中设置 iOS 部署。

回答by xalupadas

You need to change the base SDK for the project:

您需要更改项目的基础 SDK:

  • 1) Click on your PROJECT_NAME in the Project Navigator
  • 1) 在项目导航器中单击您的 PROJECT_NAME
  • 2) Click on your PROJECT_NAME under the 'PROJECT' label on the next panel
  • 2) 在下一个面板的“PROJECT”标签下点击您的 PROJECT_NAME
  • 3) Click on the 'Build Settings' tab
  • 3) 单击“构建设置”选项卡
  • 4) Under 'Architectures'->'Base SDK' -> 'Debug', select the 'Latest (iOS4.3)'
  • 4) 在'Architectures'->'Base SDK' -> 'Debug'下,选择'Latest (iOS4.3)'
  • 5) Under 'Code Signing'->'Debug'->'Any iOS SDK', select your Apple Provisioning Profile
  • 5) 在“代码签名”->“调试”->“任何 iOS SDK”下,选择您的 Apple Provisioning Profile
  • 6) Under your project schemes you should be able to select iPhone/iPad.
  • 6) 在您的项目计划下,您应该可以选择 iPhone/iPad。
  • Voila!
    PS: You should be able to see all the SDKs that you have installed on step 4).

    瞧!
    PS:您应该能够看到您在第 4 步中安装的所有 SDK。

    回答by Wenjing

    Check your SDK and sign in identity in your build configuration. That's how I solved this issue.

    检查您的 SDK 并在您的构建配置中登录身份。我就是这样解决这个问题的。