The selected run destination is not valid for this action - xcode

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.

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 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

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 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

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 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 similar issue recently. Got it solved by doing some changes in Base SDK of Project. Following are steps :
Click on the top-level project icon in the left hand panel
In the right hand panel that appears, select Build Settings (near the top).
Select "All" option (instead of Combined)
Ensure Base SDK is set appropriately, like "OS X 10.7", "Latest iOS(6.1)" etc.

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.

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

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'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.

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.

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.

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'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 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.

Related

How to open higher xcode version project(13+) into lower xcode version(12 or lower)?

I recently updated my XCode to latest(period) 13.3 and working on a project on that, Now when i moved that project to other mac which has MacOS Catalina and has XCode version 12.3.
When i try to open the project it keeps showing me this dialogue
But i found a solution to make it work on lower version XCode which can be useful to other people too, So i am including answer too.
Hope It Helps :)
Just have to follow steps given below
Right Click On Your_Project_Name.xcodeproj and select Show Package Contents from the option menu. { Even if you have .xcworkspace, ignore it for now }
Open project.pbxproj from opened folder.
Change object version to 46 like given below
Hit Command(⌘) + S to save it and close the window.
If you have pods installed on that project then you have to reinstall them again { I guess you already know how to do that or follow setps given below }
Open Terminal
Run Command cd PATH_TO_YOUR_PROJECT_FOLDER, Hit Enter
Run pod install {No need to open podfile as we never made a change to it} and we're done
Go back to project folder and open Your_Project_Name.xcodeproj or Your_Project_Name.xcworkspace
NOTE:
Since It is work around way, we can not run this on newer iOS version simulator on which we want to test code However, we can run the code on physical device which has newer iOS version { which is also tricky part! }
TO RUN THE CODE ON LATEST IOS PHYSICAL DEVICE, FOLLOW BELOW STEPS
Download zip of your desired iOS version to run from the link
Close the XCode App.
Right click on XCode App from Application and select Show Package Contents
Move the downloaded folder to Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport.
Open the project and run it on physical device
If you get error of Unable to install the Application, click on Details and try to resolve it.
If your error says The code signature version is no longer supported then check out this answer, it solved the error.
Hope It Helps !!!

xcode 8 error denied by service delegate (SBMainWorkspace)

Trying to run a build on simulator and I get this error:
The request to open "com.companyname.appname" failed.
The request was denied by service delegate (SBMainWorkspace) for
reason: Security ("Entitlement
"com.apple.frontboard.debugapplications" required to launch
applications for debugging").
This was not there when using the GM of Xcode 8, but started soon as I downloaded it again form the mac app store.
Google is no help neither is the Apple developers forum.
Any help or suggestions?
Quitting the simulator and relaunching fixed this for me.
In case anyone is wondering what is meant by "empty settings" that should be unchecked as mentioned in the answer of maricle and in the comment of Vinayak GH
At least that is what caused the problem for me.
Make Sure that you have not Checked Any "empty settings" in Product > Scheme > Edit scheme > Run > Environment variables. this cause the above issue.
check your scheme settings and make sure all empty settings are unchecked.
The only thing that worked for me was:
Simulator > Reset Content And Setting
Then clean and run your project
I have suffered from this problem for a couple days. Basically I have tried every way which can be found on the internet but none of those was helpful indeed. I even reinstalled Xcode two times (Xcode 8.3.2 8E2002, simulator iOS 10.3 14E269). And of course, there was nothing wrong with my project, scheme and empty settings.. everything seems normal. Finally I found that the best way to solve this is before you deploy your app to the simulator, you should clean your project (shift + cmd + K) and then you run again (cmd + R). This will solve your problem.
Build Setting > Combined > Linking > Mach - o - type change to executable
This worked for me because I had changed that to static before.
For me, the problem seems to be related to my being a bit too hasty to remove some red-hilighted Pod frameworks. I thought they were missing, but the entitlement error started immediately after I removed them. The error persisted until I ran pod install to reinstate the deleted Pod frameworks.
Uninstall (Delete) App from Simulator and run it again. works for me.
I followed all the other suggestions in here, and for me, it would fix if I restart Xcode and simulator, then it would work once. After that, the issue would start happening again until I did another restart.
What fixed it for me was to delete the scheme and recreate it.
I got this error when I use "/" character in target name. Fixed after deleting it.
Xcode 10: Erase All content on simulator > Quit Xcode > Reopen XCode & Rebuild worked for me
Try to change your project's Build System to New Build System...
Xcode -> File -> Workspace Setting -> Build System : New Build System.

The selected device specifies an unsupported architecture

I'm trying to launch an Objective C app built on Xcode5 on Xcode6 beta (Version 6.0 (6A215l)). I get the following message when trying to build for any platform except for iPhone 5s:
Xcode cannot run using the selected device.
The selected device specifies an unsupported architecture.
It's not even obvious how to begin troubleshoting this as I can't get to the point where the console is activated. Any pointers?
I just had this myself.
I tried a few things (closing simulator before running, having it open, resetting), but what seemed to fix it was a simple clean, build and then run
If that's not it then I have a couple of other things I did but I don't think they were responsible
I was getting the same issue when the Xcode-> Targets-> General-> Deployment->Devices selected is iPad. but I am going to run this project on iPhone. check your project.
I bumped into this issue after changing the Executable file field in the info tab of my target settings - changing this back to the default ${EXECUTABLE_NAME} fixed it for me.
I was getting the same issue and no amount of cleaning solved it. I had to remove all Swift files from my project. Then I re-added them, but made sure to unselect the "Add to Target" option in the file add dialog. Finally, manually added them to the "Compile Sources" section of your project's "Build Phases". This did it for me. (Also make sure no Swift files end up in the "Copy Bundle Resources" section of Build Phases).
Close simulator if it is opend
Press Command + shift + k (or clean the project by selecting product menu item from xcode menu) and then press Command + r (or run the project)...
iPhone3gs-->iPhone4s:armv7
iPhone5/iPhone5c: armv7s
iPhone5s --> iPhone6Plus :arm64
add architecture to BuildSetting -> Architecture

Clean Build Folder option disabled in Xcode 5

I have an iOS project that builds and runs fine, but the "Clean Build Folder..." option is disabled. As a matter of fact, it is disabled in all of my projects (all iOS, some in workspaces).
They have not been upgraded from previous Xcode version as discussed in this thread.
To See the Clean Build Folder... option, hold the option key while viewing the Product menu.
What can I do to enable it?
Update:
Almost a year later. Currently on Xcode 6.3. Still no luck.
I tried the following steps.
Preference --> Locations -->
For derived data, click "Advanced".
Inside build location, choose "Unique".
The "Clear Build Folder" button appears again.
I had this problem with a project in Xcode 8, and found that in addition to the setting #ycwjjjj mentioned, I also needed to check File → Workspace Settings… → Advanced… and switch away from Custom Settings to Unique (or Xcode Default).

iOS5 Storyboard error: Storyboards are unavailable on iOS 4.3 and prior

I've built a small app using storyboards and it ran great. Just before final testing I decided to try it out to see if it runs on iOS 4.3. I clicked on the gray 5.0 in the project settings and selected 4.3.
The app failed to build with the following error message:
Storyboards are unavailable on iOS 4.3 and prior
Both the iPhone and iPad storyboards tell me that.
The issue that when I switched back to iOS5 target, I still keep getting these errors from both storyboards, and the product won't build!
I checked: iOS Deployment target in projects settings is 5.0
Target app deployment target is 5.0
Build settings uses iOS 5.0 SDK
What else do I need to do to restore my project to a buildable state? Is this a brand new bug or am I forgetting something?
Update: I kept getting this error even after doing a clean.
I changed the debugger in Schemes to "LLDB" and did an additional clean, the project now builds and compiles
I also got this problem and finally I solved this by following procedure:
Open XXXXXX.storyboard
Open Identity and Type tab in your right view of Xcode.
Set the value of Development in Document Versioning to "Xcode 4.2" (my default value is "Default Version (Xcode 4.1)".
Change the value of Deployment from Project SDK Version (iOS 5.0) to iOS 5.0, then back to Project SDK Version (iOS 5.0)
Rebuild the project and the error should be resolved.
The solution that worked for me was just to delete the ~/Library/Developer/Xcode/DerivedData directory for my project.
I'm just going to add this one as another possible answer here, as the first solutions worked for me several times (as I mentioned in my previous comment) until today when I couldn't get my project to compile for love nor money with the same error.
With the debugger changed and Xcode set to 4.2 and restarting several times I could not compile. However I discovered another way to get around this issue.
Select the storyboard in the left column and 'Show in Finder' and drag the storyboard to the desktop. Xcode will now change its colour to red and be unable to compile.
Clean the project, drag the storyboard back from the desktop to the directory in finder.
Then, it builds and the error goes away again.
I don't know what triggered the error originally as I'm developing under iOS5 and building for 4.3, but it seems to come up from time to time and.
This seems to be a bug in the latest XCode that I've also run into too, did try the OP's solution of changing debugger and that had no effect.
It cropped up for me since I tried storyboard with 4.3 and then tried to change back.
My solution was to close XCode, open it again and clean. Then I compiled and it worked fine.
Hope this helps others.
While other solutions helped me, they didn't work 100% of the time. I don't know enough about XCode to know how reliable this solution is, but at least it worked for me so you can try it in your project.
In the left hand side of Xcode, open the project navigator. Click the top item, which is your project. In the panel immediately to the right, you'll see a choice to choose between your project and its targets. Click the project, and then in the panel to the right, under the "Info" tab, set "Command-line builds use" to Debug (in my two projects where I was having the error, both were set to Release).
A picture is probably easiest:
Another idea: Open another project with storyboards in Xcode and try to run that. If it succeeds, you can come back to the current project and it should build. I think this clearly indicates a bug in Xcode.
After trying all the answers in here (removing the Storyboard reference, quitting Xcode, cleaning, changing debugger, etc.), none worked (with Xcode 4.5).
The only way I got it to rebuild (and it was a total guess) was to open the Storyboard file in a text editor and delete the following line:
<deployment version="1280" identifier="iOS"/>
It should be near the top of the file, in the <dependencies> section. After that, the project was built successfully and Xcode even re-added that line to the file, but, it still builds...
Go figure...! Hopefully it can help someone!
At last, an elegant workaround that seems to do the trick for me! (I sure hope it works for everyone else. This one's stubborn.)
Once your settings are back safely in iOS 5-land, try Cmd-Option-Shift K (aka "Clean Build Folder..." from the menu - hold down Option to see it), then build.
the solution is simple,
right click your storyboard file, and show in finder
then select the folder where the file is (this would probably be in the en.lproj folder)
right click on the MainStoryboard.storyboard file causing the problem and open with text edit
find the line that reads or something like this:
<development version="4300" defaultVersion="4200" identifier="xcode"/>
and change it to something like this:
<development defaultVersion="4300" identifier="xcode"/>
save the file and build. Et voila...
Ok, I tried everything above and problem still occurred. So I just remove storyboards (as reference not move to trash). then build successfully; after that I added them again; Build, And finally worked.
I was having the same problem. I tried all the above answers and all combinations and nothing worked. Then later after doing some research, I analysed that the simple fact that the error that was throwing at me was straight forward.
Just go to the Build settings and instead of selecting the xcode project file, select the product file and change the Deployment target to 5.0 or 5.1. The error should go off.! I did this in Xcode 4.3 in Lion OSX. It worked fine for me!!
I also had this problem, and nothing helped. Even opening another project and trying to build failed.
What I did, and what for me, was going to project -> info and under "Deployment Target" change iOS Deployment Target to whatever, build and than change back to whatever it was and build again.
Here is yet another random, voodoo, flail that seemed to workaround the bug just now. (after other techniques here had not helped) I renamed the storyboard file (and the entry for it in the info.plist file). Haven't tried the "drag to/from desktop" ritual yet.
Tonight, I have lost like 45 minutes to this issue. grrrrr. Ok I feel better now.
After trying all the suggestions above, without success, I got my code to compile doing the following.
Edit -> Refactor -> Convert to Objective-C ARC
rm -rf $HOME/Library/Application Support/Developer/Shared/Xcode
rm -rf $HOME/Library/Preferences/com.apple.dt.Xcode.*
rm -rf $HOME/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState
rm -rf $HOME/Library/Developer/Xcode
seems to help with Xcode 4.3.2
Had similar issue. XCode would build and run other projects fine but couldn't get rid of the error on project I had changed, not even backups from server. Tried all the above solutions but nada. Here is what worked.
Uninstall XCode.
Delete user/library/developer/XCode folder.
Reinstall XCode (maybe you should start this before searching for the folder, download took me 20 minutes).
Start up, clean and build.
Worked for me. Saved me some time. Sometimes when the scalpel doesn't work it's time for the hatchet. Now I get to pick a new font to code in (this will clear your preferences)!
The only solution that has worked for me is to create another project without Storyboarding enabled, build it, then switch back to the storyboard project, clean and build.
Here is yet another random, voodoo, disconnect your iPhone if it is connected.
I simple changed deployment target to 4.0 and Development to 4.3 from MainStroyboard.
I clean the project; and restarted the mac, :) i know it sounds funny but restarting xcode didn't helped. maybe there is a cache in memory...
Then i built the project ; it was ok!

Resources