How did my Xcode project get changed from iOS project to an OSX project?
Asked Answered
H

5

10

I've been doing only iOS development and never made an OSX app. In the iOS project I'm working on now I see that suddenly Xcode thinks it's an OSX project. The all my framework files are shown in red (missing), and lots of the options in the project panel show choices that are only appropriate for OSX such as "deployment target", which offers only 10.4, 10.5, 10.6 etc. and in Build Settings the Valid Architecture shows i386 x86_64 with no drop-down options.

What happened? How can I change this back to an iOS project?

Hiles answered 1/8, 2013 at 2:51 Comment(7)
Go home Xcode, you're drunk.Fassold
Click on the xcode project(the little blue thing) and make sure all the settings say iosWorkroom
By 'little blue thing' I guess you mean the project in the upper left corner of the project navigator panel. No they don't all say iOS which is the problem, and there seems to be no way to change them. For example if I choose "project" in the narrow column I have 2 tabs in the big center section "Info" and "Build Settings". The Build Settings tab has iOS and iPhoneOS for everything, but the Info tab has OSX entries for everything. For example the top section in the Info tab is titled "Deployment Target" and the only entry in it is labeled "OS X Deployment Target" with a drop-down for version.Hiles
Use your source control and diff your project files before/after the problem.Fassold
Yes I tried that. I saw differences in the project build options that are probably related but I don't see why any of them would make Xcode think it should be building a Mac OSX project. Nothing that changed mentioned anything related to OSX as far as I know. Anyway, I restored a snapshot and it builds an iOS target as expected so I'm back in business. I wish I could understand what happened but I guess I'll never know.Hiles
I once had this happen and ended up having to copy the source files to a new project and rebuild. Probably could have figured it out eventually, but it was faster to just do the "brain transplant". Only happened the one time, for reasons unknown.Victorvictoria
Just happened to me in Xcode 11.7. I did really nothing in settings, but I coded a lot and I didn't want to rollback all my work in Git. Instead I committed my changes, clear the project and completely restarted Xcode (closed all open Projects, not just this one). It helped.Felisha
C
6

could be 2 late to answer this question, however, this answer might help someone in the future, as the above answer wasn't helpful for me, so here is what I have done.

1- on the left top corner of Xcode click on the scheme.

2- click edit scheme

enter image description here

3- in the new window change "Executable" from non to the name of your project scheme "target"

enter image description here

4- on the top where it says "My Mac 64-bit" if it didn't changed automatically to iPhone/iPad change it manually.

enter image description here

5- if there wasn't any option, in bottom of the window click "Manage Schemes" and make sure the check box next to your project scheme is checked.

hope this could help and save anyone time.

Croupier answered 26/11, 2013 at 22:3 Comment(0)
B
6

By your comment you should not have an issue navigating this.

Go to your Project (in upper left) -> Project (project name in submenu) -> Build Settings -> under Architectures menu select Base SDK and choose iOS 6.1.

enter image description here


This should switch your project back. Now under Info you should see your Deployment Target options have switched from saying OS X Development Target to iOS Development Target

enter image description here


As for why it originally changed, I have no idea. But hopefully this will fix your issue.

Blase answered 6/8, 2013 at 15:13 Comment(4)
I think when this happened to me the iOS SDKs were not shown as being available. (Though other projects were not affected.)Victorvictoria
@HotLicks got it. I was just going based on his first comment, which only included him looking at the Deployment Target (in second picture).Blase
I'm giving this answer a green check because it's clear and well written and probably answers this for others. But I don't think this would have been the answer for my situation. I remember that there were no drop-down choices for Base SDK. The only way to change it was to double-click in the text box and type a choice. I tried a few different possibilities. I copied the entry from another project that worked and entered (if I remember right) "iPhone iOS" or something like that. The absence of drop-down choices was probably a clue that something was screwed up. But I still don't know what.Hiles
@Hiles based on your memory and HotLicks comment you are probably right. I have never had this happen to me so it was really just an educated guess. Figured it might help. Thanks BTW!Blase
C
6

could be 2 late to answer this question, however, this answer might help someone in the future, as the above answer wasn't helpful for me, so here is what I have done.

1- on the left top corner of Xcode click on the scheme.

2- click edit scheme

enter image description here

3- in the new window change "Executable" from non to the name of your project scheme "target"

enter image description here

4- on the top where it says "My Mac 64-bit" if it didn't changed automatically to iPhone/iPad change it manually.

enter image description here

5- if there wasn't any option, in bottom of the window click "Manage Schemes" and make sure the check box next to your project scheme is checked.

hope this could help and save anyone time.

Croupier answered 26/11, 2013 at 22:3 Comment(0)
I
0

I know this is an old post, but this just happened to me in a project with multiple targets.

I'm using github and it had marked one of my target scheme files with a merge block at the top of the file after using a newer compiler. I could find a way to edit the scheme through XCode, but upon re-opening the project, it would be bad again.

I had to edit the file manually and complete the merge edit.

Interstitial answered 16/7, 2014 at 15:20 Comment(0)
C
0

This recently happened to me with Xcode 8 where an old iOS project was turned into a dual destination macOS / iOS one.

To fix the issue I changed the Base SDK under Project -> Build Settings to Latest iOS (iOS10) and the change rippled through removing the macOS destination.

Catchy answered 27/9, 2016 at 19:20 Comment(0)
L
0

I fixed this by deleting the scheme showing issue and recreate it. This time it gets created as desired scheme type showing all the simulators and devices attached, if any.

Lauricelaurie answered 17/4, 2020 at 2:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.