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

我开了一个一直以来都是 iphone/ipad 的项目。我现在无法构建它,因为出于某种原因,我唯一的“ Scheme”选项是“ MyAppMyMac64位”。我怎样才能把这个设置返回到 iphone/ipad 模拟器和设备?我的“目标设备系列”设置是 iPhone/iPad。

97250 次浏览

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").

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.

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

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

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.

I had that issue several times. Basically, just set the Base SDK in Build Settings to Latest OS X and it should work properly.

I've just got this error, for me it was because of some reasons my device name didn't appear in xcode devices dropdown, just a generic name. Unplugged and plugged back the device and was fine.

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.

You should change:

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

to:

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

For me I had to combine a couple of the solutions here to get it to work. For me the Project Build Settings were set to "Latest iOS" already.

To fix it, I had to change it to "OS X 10.6", then build the app (it will fail to build), then set it back to "Latest iOS", which now works again.

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!

I just installed Xcode 4.1 (painful!) and when I opened one of my apps that built fine before the upgrade, the only active scheme was "My 64-bit Mac". In this case, the required change was to Edit Schemes, and for the Build scheme's Info tab, set the Executable dropdown to my target. It was set to None. As soon as I did that, the simulator/device showed up instead.

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

Tried the rest of these with no joy.

AFIAK this is a version control problem, in general not just a Git problem!

I gave a colleague a copy of a project that had modified files in it and this problem occurred.

However when I committed/updated the repo and gave him fresh copy.

This problem was fixed!

I got same error and for some reason after going through all these it did not work. Notice in the very top menue is had my App Name> IOS Developer. Changed to App Name> IPhone 5.0 and went right into Simulator and got no error.

Deployment target is missing for specified 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..

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

I've hit the same issue, needing to build with the 10.6 SDK. But I've found that XCode 4.4 doesn't contain this SDK! So I had to put it back, by opening the XCode.app package contents, and going to: XCode.app/Contents/Developer/Platforms/MacOSX.platforms/Developer/SDKs and copying in MacOSX10.6.sdk from my old XCode 3 Developer folder.

Surprisingly enough, this works! When you quit and relaunch XCode, and select the Base SDK for the project, 10.6 appears in the drop-down.

But beware, when XCode installs an update, you'll have to repeat this process, as I found just now after updating to 4.4.1.

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

  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.

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