ios 选定的运行目标对于此操作无效

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

The selected run destination is not valid for this action

xcodeiostarget

提问by sol

I have opened a project that has always been iphone/ipad. I can't build it now because for some reason my only "Scheme" option is "MyApp My Mac 64-bit". How can I get this set back to iphone/ipad simulator and devices? My "Targeted Device Family" setting is iPhone/iPad.

我打开了一个一直是iphone/ipad的项目。我现在无法构建它,因为出于某种原因,我唯一的“方案”选项是“MyApp My Mac 64 位”。我怎样才能把这个设置回 iphone/ipad 模拟器和设备?我的“目标设备系列”设置是 iPhone/iPad。

回答by fabrice truillot de chambrier

I had that issue several times. Basically, just set the Base SDKin Build Settingsto Latest OS Xand it should work properly.

我有好几次这个问题。基本上,只要设置Base SDKBuild SettingsLatest OS X它应能正常工作。

回答by iruleonu

I ran in to this issue recently and i solved it by changing the value of the executable from "None" to "AppName.app" on xcode.

我最近遇到了这个问题,我通过在 xcode 上将可执行文件的值从“无”更改为“AppName.app”来解决它。

You should change:

你应该改变:

Product > Edit scheme -> Run AppName.app -> Info tab -> Executable -> None

产品 > 编辑方案 -> 运行 AppName.app -> 信息选项卡 -> 可执行文件 -> 无

to:

到:

Product > Edit scheme -> Run AppName.app -> Info tab -> Executable -> AppName.app

产品 > 编辑方案 -> 运行 AppName.app -> 信息选项卡 -> 可执行文件 -> AppName.app

回答by Scott Corscadden

Have you tried editing the Scheme? (I'm assuming you are running XCode 4). I believe you just might need to set the "Base SDK" setting to "iphoneos" (this translates to "Latest iOS").

您是否尝试过编辑方案?(我假设您正在运行 XCode 4)。我相信您可能只需要将“Base SDK”设置设置为“iphoneos”(这意味着“最新的 iOS”)。

回答by Amit Anmol

I was facing same issue in my application and I solved it by following these steps: 1. Go to Project-> Build Settings 2. Change BaseSDK to Latest OS

我在我的应用程序中遇到了同样的问题,我按照以下步骤解决了它: 1. 转到项目-> 构建设置 2. 将 BaseSDK 更改为最新的操作系统

回答by gonzobrains

The above solutions didn't work for me because Xcode 4 didn't give me any choices to go back to iOS. I closed Xcode, opened it again, and then it worked!

上述解决方案对我不起作用,因为 Xcode 4 没有给我任何返回 iOS 的选择。我关闭了 Xcode,再次打开它,然后它就成功了!

回答by dlewin

I have the same problem, it appears that you also made the jump with the new Xcode 4 upgrade and this appears to be a code incompatibility.

我有同样的问题,看来您也使用新的 Xcode 4 升级进行了跳转,这似乎是代码不兼容。

If you want to keep it for IOS (Iphone / Imac ) edit Scheme [Product/Edit Scheme/ Build/ build => Destination drop down list.

如果你想保留它用于 IOS (Iphone / Imac) 编辑 Scheme [Product/Edit Scheme/Build/build => Destination 下拉列表。

Make sure you have installed the Ios SDK before running Xcode.

确保在运行 Xcode 之前已经安装了 Ios SDK。

Elsewhere if you have to compile the same app for the Mac, I'd like also to know the answer as this generate the same errors as you.

在其他地方,如果您必须为 Mac 编译相同的应用程序,我也想知道答案,因为这会产生与您相同的错误。

回答by Jayprakash Dubey

I had similar issue recently. Got it solved by doing some changes in Base SDK of Project. Following are steps :

我最近有类似的问题。通过在项目的基础 SDK 中进行一些更改来解决它。以下是步骤:

  1. Click on the top-level project icon in the left hand panel
  2. In the right hand panel that appears, select Build Settings (near the top).
  3. Select "All" option (instead of Combined)
  4. Ensure Base SDK is set appropriately, like "OS X 10.7", "Latest iOS(6.1)" etc.
  1. 单击左侧面板中的顶级项目图标
  2. 在出现的右侧面板中,选择“构建设置”(靠近顶部)。
  3. 选择“全部”选项(而不是组合)
  4. 确保基础 SDK 设置正确,如“OS X 10.7”、“最新 iOS(6.1)”等。

回答by sfkaos

I also just ran in to the issue. For me I was trying to "Build for Testing" and was running into this error.

我也刚遇到这个问题。对我来说,我试图“为测试而构建”并且遇到了这个错误。

To fix it I had to "Edit Scheme..." and then in the "Build" dropdown click on "Build" and made sure to check the "Test" checkbox for the Target.

要修复它,我必须“编辑方案...”,然后在“构建”下拉列表中单击“构建”并确保选中目标的“测试”复选框。

enter image description here

在此处输入图片说明

回答by thorb65

I had the same error message. My solution is to delete the info.plist file from build phrases -> copy bundle resources.

我有同样的错误信息。我的解决方案是从构建短语中删除 info.plist 文件 -> 复制捆绑资源。

回答by DejanR

Deployment target is missing for specified SDK ...

缺少指定 SDK 的部署目标...

Choose other "Deployment Target" (in the Build settings) and simulator will appear.

选择其他“部署目标”(在构建设置中)和模拟器将出现。

Note:It's happening when use 5.1 SDK(latest) with XCode 4 on Snow Leopard..

注意:在 Snow Leopard 上使用 5.1 SDK(最新)和 XCode 4 时会发生这种情况。