I am wondering how to handle running two versions of xcode on a mac, or if it is even possible.
I currently have a number of production apps that I service with the release xcode7. I must have this available for uploading app versions to the app store.
I also have a ipod touch device I have the ios9.1 beta running, and want to test and write code for the new os.
However, xcode7 says I can't test ios 9.1 beta, that I have to install xcode beta. Also, I've read that you can't push apps to the app store with the beta. So how can you maintain current apps, as well as, build new functionality?
Maybe I have missed something? some setting that allows me to toggle between these xcodes? or will the mac allow me to have two different versions of XCode installed? I assumed it would just override the other.
I don't want to buy another mac, or to partition the one I have, or keep downloading and installing different versions on all the devices, if I don't have to.
Any information would be helpful, how does everyone else handle this?
You simply need to rename them in /Applications; for example:
Xcode 6.4: /Applications/Xcode6.app
Xcode 7.0: /Applications/Xcode7.app
Xcode 7.1 beta: /Application/Xcode-beta.app (the default anyway).
They will co-exist perfectly happily, however if you do command line builds, you'll want to use xcode-select to select the version you want to use when using xcodebuild or clang, etc.
The betas generally come with the name Xcode-beta.app (this is true for the iOS 9.1 beta), so you can just download it and copy it to the /Applications folder as usual.
In the rare cases where that's not true, you can just rename Xcode.
You can install both versions. They will happily co-exist in your /Applications folder. One will be called Xcode, the other will be called Xcode-Beta
Related
I am attempting to run my Swift app in Xcode, and after finding out my Xcode is up to date, yet my device is not supported, I took my problems to Google. Found out through a couple sources that I need to manually add device support, using this
I added the contents from the 16.0 folder into a new folder in Xcode Device Support and renamed the folder to 16.2 as it stated I should do.
Now, when I click Build, it tries to run before popping up an error on my computer saying:
This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode. You may also need to restart your mac and device in order to correctly detect compatibility.
I'm not sure what to do as it doesn't make sense for me to attempt downgrading back to another iOS version when I should be running my app with the latest version. Why does Xcode not update these folders to provide support for new iOS versions?
If you haven't received an update, delete xcode completely from your computer and download xcode 14.2 from this link https://developer.apple.com/download/all/?q=Xcode
download it from this link
IOS device support
I have recently installed Xcode 9.0, but in order to also keep the previous version (i.e. both Xcode 8.3.3 and Xcode 9.0) available on my computer, instead of using the usual App Store Updates I have followed the instructions found here.
As much as I can see the result is pretty good.
Nevertheless the App Store application does not seem to understand that I am now up to date with Xcode 9.0.
It keeps showing me the update for it. What am I supposed to do about that? Any way to inform the App Store app?
The instructions you linked had you keep your old version and just install the standalone version of the new.
These instructions are bad. You've just found out why.
Throw away the standalone version of the new and go ahead and let the Mac App Store update your Xcode. Then download the old version from https://developer.apple.com/download/more/, rename it, and stick it in /Applications.
Also don't forget that while you can keep multiple versions of Xcode 9 open at the same time, this isn't true for older versions of Xcode. If you have Xcode 8.3 running, you can't have Xcode 9 running, and vice versa.
I have developed a Universal App that works on both an iPad running iOS 9.3.5 & an iPhone running iOS 6.1.4, using two different Storyboards.
I realise that I need to upgrade in order to be able to distribute my App on the App Store.
Can I run Xcode 7 on OS X Lion? And, more importantly, will my Objective-C code still work in Xcode 7?
The code I am using is very basic. I am essentially using a UINavigationController to present data from an SQLite database.
I am not using any animation, location services or camera based classes.
At the moment, I have set my deployment target as 6.1.
I am using 2 third party frameworks: SSZipArchive & Reachability
Can anyone give me some reassurance, before I assign a month's worth of work to the scrap heap?
It is really hard to tell, since it means jumping 3 versions (!) ahead. Anyway, I wholeheartedly recommend you to set git in your project, to make sure you can always revert if something goes wrong. BTW- I would recommend updating to Xcode 8, the latest version of Xcode.
Following are the answers to your queries :
Which version of Xcode 7, you will be using? You will have to upgrade your OS too to run Xcode 7 as it runs on OS X 10.10.4
Your code will probably work on Xcode 7, but you might have to tweak a few things. But you will have a lot of online help to fix these issues.
From Xcode 7s Release notes:
Xcode 7 requires a Mac running OS X 10.10.4
In general, you can copy /Applications/Xcode.app to /Applications/Xcode_4_6_3.app and than update (or maybe better install) Xcode 8beside it, so you can always use your legacy version side-by-side.
Without knowing your code nobody can tell if it needs modifications to build under Xcode7. As the step from Xcode 4 to Xcode 7 is big, plus you want to build for the App Store and therefor have to target iOS 10, I assume you will have to tweak your code due to deprecations and such.
You need to build with Xcode8 to archive this btw.
If you were working with Storyboard, I would also expect issues as Storyboard has been developed a lot in between.
Will my MacBook Pro OSX Lion, handle the XCode 4.6.3 to Xcode 7
Absolutely not. Xcode 7 requires a much later system version than Lion.
In general what I have done in your situation is to install the required system and Xcode onto an external drive or a partition on the internal drive, and boot from that. This allows me to experiment and see whether the transition is going to work.
There is no need, therefore, to guess — which is what it appears you are trying to do.
I'm running into compatibility issues for some external frameworks I'm using in my project. Is there a way to change the Base SDK on Xcode 8? Currently in the project settings only show me the Latest SDK.
I've tried copying the older SDK from another version of Xcode to here but it didn't work:
/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Starting with Xcode 7.3, in addition to copying in the SDK, you must also edit a certain Info.plist file, as described here for macOS in the post by agx. It looks like there is a similar file for iOS, at
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Info.plist
Try changing the value of MinimumSDKVersion in there from 10.0 to whatever SDK version you want.
I've not tried this with iOS, but, using this workaround, I was just able to build a macOS target with macOS 10.6 using Xcode 8.0 (8A218a) (the "GM").
UPDATE
The hack described above stopped working for me in Xcode 9. If you want to use Xcode 9+, see my more recent answer dated Nov 22, 2017.
My original answer, although it worked with Xcode 8, for some strange reason which is not worth explaining, no longer works with Xcode 9 on a particular client's old project. So I've been using an alternative workflow which is really not too bad.
To work on this project, I open it in both the older Xcode, which can build it with the required SDK, and in a recent Xcode. I put the old Xcode window in the background and do my work in the recent Xcode. When I am ready to test changes, I do a File > Save All (⌥⌘S), then switch to the old Xcode and Build (⌘B). When the build is done, I switch back to the recent Xcode and Product > Perform Action > Run without Building (⌃⌘R). Because the dSYM file format has not changed, breakpoints work as expected.
The advantages are that no hacking of Xcode is required, and the only thing I need to remember about the old Xcode (Xcode 3 in my case) is, mercifully: ⌘B.
One little warning: In this particular project's Target, in Build Settings, it has a custom Build Products Path. This is typical of the way Mac apps were built years ago. To ensure that both of your Xcodes are working with the same product, if your old and recent Xcodes straddle the version which changed the default Build Products Path, you may need to set Build Products Path.
The workflow could probably be made even easier by scripting the xcodebuild and xcode-select command line tools, but this is good enough. With Apple's announcement at this year's WWDC about support for 32-bit Mac apps going away during the next two years, my client has some tough decisions ahead in any case.
You just have to change the "Deployment Target" settings. You basically use the latest available SDK as base SDK but select a target OS X version.
Of course it depends on why you want to use an older SDK?
Xcode 5 has a preferences pane that allow one to download iPhone 6.1 simulator, however I can't find a place where it allows downloading of iOS 6 SDK, thus it is not possible to set the active SDK to iOS 6 when developing with Xcode 5. Is there a workaround that would allow Xcode 5 to install iOS 6 SDK?
EDIT:
Workarounds should no longer be necessary now that Xcode 5 is generally available and allows you to download previous versions of the SDK.
EDIT: Starting Feb 1, 2014, Apple will no longer accept pre-iOS7 apps for submission to App Store. So while this technique still works, it will not be useful for most readers.
Yes, this is fine. I still build with iOS 4.3 for one project (it's been awhile since we updated; but they still accepted it after iOS 6 came out), and I currently build 10.5 apps with Xcode 5.
See How to point Xcode to an old SDK so it can be used as a "Base SDK"? for details on how to set it up. You can use my fix-xcode
script to link everything for you every time you upgrade.
The only trick is getting the old SDKs. If you don't have them, you generally need to download old versions of Xcode (still available on developer.apple.com), open the installer package, and hunt around to find the SDK you need.
SDKs can be found within the installer package at:
Xcode.app/Contents/Developer/Platforms/
I was also running the same problem when I updated to xcode 5 it removed older sdk. But I taken the copy of older SDK from another computer and the same you can download from following link.
http://www.4shared.com/zip/NlPgsxz6/iPhoneOS61sdk.html
(www.4shared.com test account test#yopmail.com/test)
There are 2 ways to work with.
1) Unzip and paste this folder to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs & restart the xcode.
But this might again removed by Xcode if you update xcode.
2) Another way is Unzip and paste where you want and go to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs and create a symbolic link here, so that the SDK will remain same even if you update the Xcode.
Another change I made, Build Setting > Architectures > standard (not 64) so list all the versions of Deployment Target
No need to download the zip if you only wanted to change the deployment target.
Here are some screenshots.
Yes, I just solved the problem today.
Find the SDK file, like iPhoneOS6.1.sdk, in your or your friend's
older Xcode directory.
Copy & put it into the Xcode 5 directory :
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs.
Then you can choose the SDK like below :
Hope this helps you.
Find and download old SDK. Older SDKs are found here.
I have copied the xcode.app directory as Xcode_4.6.3.app.
Now you can test and debug in both xcode versions. You have to run them from the corresponding folders or create shortcuts in your desktop. When building from command line give the parameter as iPhoneOS6.1 instead of iPhoneOS7.0
This worked great for me in Xcode5 and iOS.
Go to into Xcode5's SDK dir. Its usually located at:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
Add a symbolic link to the old SDK like this:
sudo ln -s /Applications/Xcode_4.6.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk iPhoneOS6.1.sdk
Or more accurately from anywhere in the command line,
sudo ln -s /Applications/Xcode_4.6.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
You can download the older SDK and install it in
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
folder. Logout + Login just to make sure the changes take effect and you should see the older SDK in your new XCode
Just to add, you can actually download old versions of the simulator with Xcode 5 itself - just go to preferences and you'll find them under Downloads:
Download Xcode 4.6.x from the Apple Dev Center: https://developer.apple.com/downloads/index.action
Create a folder called Xcode4 within the Applications folder and drag-n-drop the downloaded dmg there.
Open a terminal window
$sudo cp -R /Applications/Xcode4/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
You will be prompt to enter a password since you're inside a system folder
Open Xcode 5 and you should now see both SDKs
Just for me the easiest solution:
Locate an older SDK like for example "iPhoneOS6.1 sdk" in an older version of xcode for example.
If you haven't, you can downlad it from Apple Developer server at this address:
https://developer.apple.com/downloads/index.action?name=Xcode
When you open the xcode.dmg you can find it by opening the Xcode.app (right click and "show contents")
and go to Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1 sdk
Simple Copy the folder iPhoneOS6.X sdk and paste it in your xcode.app
right click on your xcode.app in Applications folder.
Go to Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Just paste here.
Close your xcode app and re-open it again.
To test an app in iOS 6 on your simulator:
- Just choose iOS 6.0 in your active sheme.
To build your app in iOS 6, so the design of your app will be the older design on an iPhone with iOS 7 also:
- Choose iOS6.1 in Targets - Base SDK
Just note : When you change the base SDK in your Targets, iOS 7.0 won't be available anymore for building on the simulator !
Can do this, But not really necessary
How to do this
Jason Lee got the answer. When installing xCode I preferred keeping previous installations rather than replacing them. So I have these in my installation Folder
So /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs Contain different sdks. (Replace Xcode.app with correct number) copy previous sdks to
/Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
Here is my folder after I copied one.
Now restart xCode and you can set previous versions of sdks as base sdk.
Why it is not necessary
Refering Apple Documentaion
To use a particular SDK for an Xcode project, make two selections in your project’s build settings.
Choose a deployment target.
This identifies the earliest OS version on which your software can run.
Choose a base SDK
Your software can use features available in OS versions up to and including the one corresponding to the base SDK. By default , Xcode sets this to the newest OS supported by Xcode.
Rule is Use latest as base SDK and set deployment target to the minimum version app supposed to run
For example you can use iOS 7 as base sdk and set iOS 6 as deployment target. Run on iOS 6 simulator to test how it works on iOS 6. Install simulator if not available with list of simulators.
Additionaly You can unconditionally use features upto iOS 6. And Conditionally you can support new features of iOS 7 for new updated devices while supporting previous versions.
This can be done using Weakly Linked Classes ,Weakly Linked Methods, Functions, and Symbols
https://developer.apple.com/library/ios/documentation/developertools/conceptual/cross_development/Using/using.html#//apple_ref/doc/uid/20002000-SW3
Weak Linking
Suppose in Xcode you set the deployment target (minimum required version) to iOS6 and the target SDK (maximum allowed version) to iOS7. During compilation, the compiler would weakly link any interfaces that were introduced in iOS7 while strongly linking earlier interfaces. This would allow your application to continue running on iOS6 but still take advantage of newer features when they are available.
The other answers here are correct too, but I find the following steps to be the easiest:
Just download Xcode 4.6.3 from the dev center link that says "Looking for an older version of Xcode?" (currently points here) and mount the dmg.
Then in terminal, copy the SDK files over:
cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Finally, relaunch Xcode and you're done.
My app was transitioned to Xcode 5 seamlessly because it can still build with the original iOS Deployment Target that you set in the project (5.1 in my case). If the new SDK doesn't cause some insurmountable problem, then why not build using it? Surely there are many improvements under the hood.
For example, I will much prefer to use Xcode 5 instead of Xcode 4.6.3. Why? I'll get a lot more battery life because the UI scrolling of text/code areas in Xcode 5 no longer chews up an entire CPU thread.
Linking the 6.1 SDK into Xcode 5 as described in the other answers is one step. However this still doesn't solve the problem that running on iOS 7 new UI elements are taken, view controllers are made full-size etc.
As described in this answer it is also required to switch the UI into legacy mode on iOS 7:
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:#"UIUseLegacyUI"];
[[NSUserDefaults standardUserDefaults] synchronize];
Beware: This is an undocumented key and not recommended for App Store builds!
Also, in my experience while testing on the device I found that it only works the second time I launch the app even though I'm running the code fairly early in the app launch, in +[AppDelegate initialize]. Also there are subtle differences to a version built using Xcode 4.6. For instance, transparent navigation bars behave differently (causing the view to be full-size).
However, since Xcode 4.6.3 crashes on Mavericks (at least for me, see rdar://15318883), this is at least a solution to continue using Xcode 5 for debugging.
I downloaded XCode 4 and took iOS 6.1 SDK from it to the XCode 5 as described in other answers.
Then I also installed iOS 6.1 Simulator (it was available in preferences). I also switched Base SDK to iOS 6.1 in project settings.
After all these manipulations the project with 6.1 base sdk runs in comp ability mode in iOS 7 Simulator.
From 1st february Apple will reject app built only for iOS6 or lower. Here is also the official communication from Apple. Better start building for iOS7.
To clarify my statement: If you build for iOS6 or lower, apple will reject your app.
If you build for iOS7 AND lower everything is fine, this means:
you must use xcode5
you should deploy on iOS7 at least.
The content of the Apple email is pretty clear at me
"Make sure your apps work seamlessly with the innovative technologies
in iOS 7. Starting February 1, new apps and app updates submitted to
the App Store must be built with Xcode 5 and iOS 7 SDK."
I currently have Xcode 4.6.3 and 5.0 installed. I used the following bash script to link 5.0 to the SDKs in the old version:
platforms_path="$1/Contents/Developer/Platforms";
if [ -d $platforms_path ]; then
for platform in `ls $platforms_path`
do
sudo ln -sf $platforms_path/$platform/Developer/SDKs/* $(xcode-select --print-path)/Platforms/$platform/Developer/SDKs;
done;
fi;
You just need to supply it with the path to the .app:
./xcode.sh /Applications/Xcode-463.app