Use Xcode 7 with iOS 10 - ios

I want to use Xcode 7 with iOS 10.
As I understand, working with iOS 10 beta requires Xcode 8 beta, so I should upgrade my Xcode. However, my code can't be built by the new compiler, so I want to stay with Xcode 7.
How can I achieve that?

You need use DeveloperDiskImage from Xcode 8 Beta.
For this extract Xcode 8 Beta app and copy DeveloperDiskImage for iOS 10 to your Xcode folder.
Suppose you extract Xcode to Downloads/Xcode-beta.app
cp -r /Users/fanruten/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A345\) /Applications/Xcode_7.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
After copy DeveloperDiskImage you should start Xcode and connect iOS device to your mac.
Edit:
With a standard Xcode install one can create a soft link:
sudo ln -s \
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A5309d\) \
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0

You can use any SDK on an older build of Xcode simply by copying and pasting the folder of the OS you need. Also you obviously cannot have two apps with the same name so just rename them to Xcode 7 and Xcode 8.
right-click / ctrl-click the Xcode 8 application icon to show the package contents and navigate to this location and copy the iOS 10.0 or WatchOS 3.0 folder etc.
/Applications/Xcode8.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
/Applications/Xcode8.app/Contents/Developer/Platforms/WatchOS.platform/DeviceSupport
Then navigate to the same location in Xcode 7 and paste the folder.
/Applications/Xcode7.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
/Applications/Xcode7.app/Contents/Developer/Platforms/WatchOS.platform/DeviceSupport
Restart Xcode 7. You'll have to wait a while for Xcode to rebuild the symbols etc.

For me none of the above suggestions worked.
Instead, I navigated to this location(press CMD+SHIFT+K to insert the below path) (through finder)
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
And copied the 10.0(14A5339a) folder, which contains the developer disk image. I then pasted it into
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
EDIT: I'm using Xcode7 (version 7.3.1-7D1014),iOS 10 public beta 6(14A5345a)-this is released on aug 19,2016

Although copying the folder containing the disk image is still the best way to go, i had no time downloading the newest Xcode to get hold of the disk image folder, so i basically archived the app and exported it using the save for development deployment option, then installed it on the test device using iTunes app.
In my case i hade Xcode 8.0 wanting to build on a 10.2.1 iOS device.

Pascal && Fanruten are right.
tested on 12th aug, Xcode Version 7.3.1 (7D1014) AND iOS 10.0 (14A5309d) on iPhone6 Plus.
I made a symbolic link as suggested (path are a bit different... see below.) but works with linking to Xcode Version 8.0 beta 4 (8S188o).
only for completeness:
Beta 4
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A5322e\)/ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0
Beta 5
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A5339a\)/ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0

Tymac's answer almost worked for me. Rather than copy and past, I had two Finder windows opened and then dragged the iOS 10 folder to the Xcode 7 folder. Once it's in Xcode 7, open the folder and make sure there is a dmg file.
Earlier I had dragged a copy of the iOS 10 device support folder to my desktop then copied it to the Xcode 7 folder. That seemed to unpack the dmg file so Xcode 7 still complained. Needs to be a dmg file in the folder.

One warning. I tried to use XCode 7.3.1 with ios 10 images from XCode 8.1 for cordova project (it works), but had problems with push notifications permissions (different setups for ios 8/9/10). Not sure about it, but it seems to me that some compiler directives are missing in 7.3.1

Here it is for XCode 9 and iOS 11 Beta 1:
sudo ln -s \
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0\ \(15A5278f\) \
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0

my two cents for Xcode Version 11 beta against Xcode 10 after wwdc2019:
ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.0
so I can use my iPhone with iOS 13 beta in Xcode 10.
after ln -s , pls relaunch Xcode

Related

Use Xcode 7.3.1 with iOS 10.1 (14B67) device

I'm using Xcode 7.3.1 (7D1014). I want to install my app on an iPhone 7 plus with iOS 10 (14B67).
I have the 10.0 (14A345) folder from Xcode 8 in Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport.
I used this code ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.1\ \(14B67\)/ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport in Terminal to create an alias named 10.1 (14B67).
The DeviceSupport-folder looks like this:
But I'm still getting Could not find Developer Disk Image when trying to build on my iPhone device.
What can I do?
UPDATE
The only solution seems to have the original 10.1 (14B65) folder. You can download the folder for 10.1 (14B65) here: http://www.filedropper.com/showdownload.php/10114b65
iOS 10.1 requires Xcode 8.1. So you need to get 8.1 installed then you can add the soft link.

How can I run my app compiled in Xcode 7.3.1 on the iOS 10 Simulator

So, because of all the naming changes my current project doesn't run on Xcode 8 beta and has lots of compilation errors that I cannot easily get rid of.
Is there a way to at least run a compiled version that was made in XCode 7.3.1 on the iOS10 Simulator?
The trick is to create a symbolic link the DeviceSupport folder from the beta to the stable version
From terminal
ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A5261u\) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

Build and Debug using ios 8.4 SDK in Xcode 7

Xcode 6.4 doesn't allow to debug on iOS 9 devices so i installed xcode 7 but it doesn't have iOS sdk 8.4 installed. Since I have a xcode 6.4 installation, i copied the
iPhoneOS8.4.sdk to the /Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs folder
and copied the
iPhoneSimulator8.4.sdk to /Applications/Xcode 3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs.
However the iOS 8.4 sdk does not appear in the base sdk options list.
In addition to copying the iPhoneOS8.4.sdk folder you need to edit
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Info.plist
and set MinimumSDKVersion to 8.4 and restart Xcode. Then Xcode will find and list the older SDK.
There is one work around for this situation. I used to do this in my routine work as below:
Open your project in Xcode 6.4 (You can see iOS 9 device debugging is disabled)
Now just open Xcode 7 (without any project opened from it) such that it looks active in "Dock Tray".
By doing above two steps, Xcode 6.4 will now enable to debug with iOS 9 devices.
Hope this helps.
You were copying an iPhoneOS8.4.sdk which is a relative symlink to iPhoneOS.sdk in that same folder in xcode6. So you ended up with two symlinks (..8.4, ..9.1) pointing to xcode7’s iPhoneOS.sdk (which is iOS 9.1)
Remove any changes you made.
You got two options. The first is the preferred one, as xcode7 updates will delete your 8.4 SDK in the future.
create a symlink called iPhoneOS8.4.sdk in the xcode7-folder. Let it point to your xcode6 iPhoneOS.sdk (which is iOS 8.4)
Use this command from your xcode7 sdk directory
ln -s <your xcode6 path>/iPhoneOS.sdk iPhoneOS8.4sdk
copy the xcode6 iPhoneOS.sdk folder to the xcode7 location. Do not overwrite iPhoneOS.sdk (which is xcode7's iOS 9). Rename it to iPhone8.4sdk instead

How can I install the new iOS SDK on Xcode 5?

How can I install the new iOS SDK on Xcode 5 to be able to compile applications for the new iOS on Xcode 5? I've tried to use iTunes to transfer compiled applications to the device. But it doesn't work any more.
Edit
I've tried to copy SDK folders from xCode 6 to xCode 5 as described on here. But, it doesn't work because of an issue with ibtool during compilation process
Yes you can.
If you're using Mavericks and want to continue using Xcode 5, do these steps:
Rename Xcode.app to Xcode 5.app
Download and copy Xcode 6 to Applications-Folder, and rename it to
Xcode 6.app
and...
Execute this command in Terminal:
sudo ln -s /Applications/Xcode\ 6.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/8.0\ \(12A365\)/ /Applications/Xcode\ 5.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/8.0\ \(12A365\)
If you are trying iOS8 you can't use anything less than Xcode 6 beta.

Import iOS 6 SDK into Xcode 4.2 on Snow Leopard

I installed Xcode 4.2 on a Snow Lopard and when iOS SDK was published I imported the iOS 5.1 SDK following this topic Is it possible to get the iOS 5.1 SDK for Xcode 4.2 on Snow Leopard?
Now I need to import iOS 6 SDK and I would know if this tutorial is still working for iOS 6 SDK.
Thank you!
This worked for me (after "su -", so I'm running as root), and with the Xcode 4.5 .dmg file mounted as a disk drive.
echo copying iPhoneOS6.0.sdk
cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
echo copying iphonesim6.0.sdk
cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
echo copying devicesupport for 6.0
cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/6.0\ \(10A403\) /Developer/Platforms/iPhoneOS.platform/DeviceSupport/
#remove old -latest- link
rm -f /Developer/Platforms/iPhoneOS.platform/DeviceSupport/Latest
echo setting up Latest link
cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport/
ln -s ./6.0\ \(10A403\) ./Latest
Note: Xcode dmg file available from https://developer.apple.com/downloads/index.action?name=Xcode (1.56 GB)
I tried following the tutorial that you have linked.
It works perfectly for me. Just copy "6.0" instead of "5.1".
With a Intel Core Duo (32 bit) running Snow Leopard the iOS 6 simulator doesn't work (because some of the libraries are missing 32 bit variants).
It also appears that while it is possible to test on an iPhone 4 device upgraded to iOS6 by copying the iPhoneOS.platform files but it does not appear to be possible to do the same with an iPhone 5. I assume this is due to the new armv7s format on the device.
So what you can do depends on your mac and your iOS device.
For the building of Cordova projects the same procedure works, however you will probably get this error:
dyld: Library not loaded: /usr/lib/system/libdispatch.dylib
Referenced from:
/Developer42/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/libSystem.dylib
Reason: no suitable image found. Did find:
/Developer42/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/system/libdispatch.dylib:
unknown required load command 0x80000023 Command
/Developer42/usr/bin/ibtool failed with exit code 255
This build fail happens because of /Classes/MainViewController.xib which is not compatible with iOS 6.... i think ;)
The workaround:
Select your projects target and expand the Supporting Files folder. Inside this folder, click on any file OTHER THAN MainViewController.xib. You need to expose the File Inspector. After you expose the File Inspector, select the file MainViewController.xib. At this point xcode will try to crash, don't let it!... just keep pressing Continue in the crash prompt until the File Inspectors settings changes to reflect the .xib file. You should keep pressing Continue until you get past the crash prompts such that you can make edits to the File Inspector. In the File Inpsector, under Target Membership unselect the target.
Close xcode, reopen and all should be golden!!
Avoid selecting MainViewController.xib in the future as it will crash your session.
I just tried to import the iOS 6 SDK into Xcode 4.2 for Snow Leopard, but when I tried to build one of my old projects, I got the same errors that iOSGuru mentioned. The troublemaker seems to be the iOS 6 simulator. Once I removed the iOS 6 simulator, my old project built normally using "Latest iOS(iOS 6.0)" selected as the Base SDK. That means I can't test on the iOS 6 simulator, but I'm testing on my real device running iOS 6 so I don't think that's such a big deal.
I haven't tried to build anything using iOS 6 features yet, so there's a chance something might still break there, but omitting the iOS 6 simulator seems to let me build with the iOS 6 SDK.

Resources