Debug on iOS device with newer release than Base SDK - ios

I have a bug (UI unresponsive) on an app that is built with iOS12 SDK. The bug does not appear if built with iOS13 SDK (but to do this this requires lots of other destabilising changes). I would like to just patch the iOS12SDK build for now until our iOS13SDK build is ready for release.
The problem being is I can't run the debugger on an iOS13.x device on xcode 10.3 to find out what the problem actually is!
It used to be that you can set the Base SDK in xcode to previous versions. There is still a Base SDK option which is set to iphoneos (possible to also use iphoneos13.1), and I have tried ln -s'ing my xcode 10.3 iphoneos12.4.sdk into the xcode 11.1 platforms directory, but xcode does not find it.
Any ideas?

Copy and paste iOS13.x Device Support to the below location.
Xcode app > Show package contet > Contents > Developer > Platforms > iPhoneOS.platform > DeviceSupport
You can download device support from here :
https://github.com/iGhibli/iOS-DeviceSupport

Related

How to fix error "Could not locate device support files"

I have the latest Xcode 11.1
iOS is updated to the latest release 13.2
I'm getting error:
Could not locate device support files.
This iPhone 6s is running iOS 13.2 (17B84), which may
not be supported by this version of Xcode. An updated
version of Xcode may be found on the
App Store or at developer.apple.com.
This happens to all iOS devices running 13.2
What I'm missing here?
That's easy.
Those files are contained in Xcode itself.
Thus, all you have to do to use devices with a newer iOS version - create junction folder (hard link) of those support files from new Xcode (in our case - the beta 11.2) to older Xcode (11.1).
And yes, before that you have to download beta Xcode 11.2.
Otherwise, you also can download only support files from the Internet, if someone already shared them and just toss 'em to Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
P.S. to create junction folder use this command in terminal:
ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.2 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
It allows you to not to duplicate the same files across your Mac
P.S. Be aware! You have to launch newer Xcode (Beta) you downloaded at least one time to install updated Xcode Tools before you can use symlinks (hard links, junction folder) to Device Support files in older Xcode, otherwise you'll get an error and will not be able to build your app.
I've been reading about hacks to get it to work on the current version of Xcode. Honestly not interested in going down that path. Bottom line, Apple released iOS/iPadOS 13.2 but did not release Xcode 11.2 (still in beta). Gotta go to developer.apple.com and download the latest beta of Xcode 11.2 to run apps on both iOS and iPadOS 13.2 devices. Hopefully they release Xcode 11.2 soon. The last beta was from Oct 11.

Xcode: Could not locate device support files

As i am trying to run my application from newly updated Xcode 8 to my iPhone 4 which is running iOS 7.1.2
It throws below error,
And, this is my Xcode version,
Has anyone faced this issue before? Awaiting for your suggestions!!
Actually, there is a way. You just need to copy DeviceSupport folder for iOS 7.1 from Older Xcode to the new one. It's located in:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/7.1
If you don't have the 7.1 files anymore, you can download a previous version of XCode on https://developer.apple.com/download/more/, extract it, and then copy these files to following path
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
Credit
I had a similar problem because the app store version was missing iOS 10.1 support in Xcode 8 and they haven't rolled an update yet. This caused the "Xcode: Could not locate device support files" problem. You can download the latest update https://developer.apple.com/download/ and it is more current and supports iOS 10.1 (14B72c).
I have Xcode 10.1 and I can not run my application on my device with 12.2 iOS version.
The easiest solution for me was:
Go with finder at Xcode location
Right Click -> Show Package Contents
Contents -> Developer -> Platforms -> iPhoneOS.platform -> DeviceSupport
Here you find a list of supported version. Choose the most recent one and copy(In my case was 12.1 (16B91))
Paste in the same folder(DeviceSupport) and call it with the version you need.(In my case was 12.2 (16E227))
Close Xcode if you have it open
Reconnect device if it was connected
Open Xcode and build
If this trick does not working, you have to get the versions from the new Xcode version.
But you can try, saves a lot of time. Good luck!
EDIT: Or you can download your needed device support from here:
https://github.com/iGhibli/iOS-DeviceSupport/tree/master/DeviceSupport
You need device support from previous version of Xcode (7.3.1).
I would recommend to use this tool: https://github.com/KrauseFx/xcode-install
When you install Xcode 7, you should link support files to Xcode 8:
sudo ln -s /Applications/Xcode-7.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/7.* \
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
This error is shown when your XCode is old and the related device you are using is updated to latest version. First of all, install the latest Xcode version.
We can solve this issue by following the below steps:-
Open Finder select Applications
Right click on Xcode 8, select "Show Package Contents", "Contents", "Developer", "Platforms", "iPhoneOS.Platform", "Device Support"
Copy the 10.0 folder (or above for later version).
Back in Finder select Applications again
Right click on Xcode 7.3, select "Show Package Contents", "Contents", "Developer", "Platforms", "iPhoneOS.Platform", "Device Support"
Paste the 10.0 folder
If everything worked properly, your XCode has a new developer disk image. Close the finder now, and quit your XCode. Open your Xcode and the error will be gone. Now you can connect your latest device to old Xcode versions.
Thanks
Here is the correct way of handling support errors from Xcode. All you have to do is add support to Xcode's DeviceSupport folder.
Open this link, extract the zip and copy the folder. https://github.com/mspvirajpatel/Xcode_Developer_Disk_Images/releases/tag/12.3.1
NOTE: A new version of iOS 13.0 beta recently released. If your Xcode throws iOS 13.0 support files needed, then click the link below:
https://github.com/amritsubedi/iOS-Developer-Disk-Image/blob/master/13.0.zip
Then, go to Applications -> Xcode. Right click and open Show Package Contents. Then, paste to Contents -> Developer -> Platforms -> iPhoneOS.platform -> DeviceSupport and restart Xcode.
Note: If you have a problem with any other version of iOS, then download the right iOS Developer Disk Image and paste it in the above-mentioned folder.
This will work.
Having the same exact issue with iOS 10.3 and Xcode 8.2.1. I'm not going to download the new Xcode beta just to fix this. Come on Apple!
To anyone reading this, you have to go to https://developer.apple.com/download/ and get the latest version, which might even be the beta, if the stable release doesn't work.
In the future, I would be aware if you update iOS on your devices you may break Xcode/iOS version so update wisely if you want to keep testing on it without jumping through hoops that Apple makes.
If you have XCode 8.1 and iOS 10.2, update XCode manually to 8.2.1. For some reason App Store didn't offer this update.
In case of getting "Could not locate device support files" after your device iOS version has been updated and your Xcode is still old version, just copy old SDK under new name and restart Xcode. Open your terminal and do following:
$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
$ cp -rpv 10.3.1\ \(14E8301\)/ 11.2.1
Restart Xcode and it will most probably work.
Download & mount http://adcdownload.apple.com/Developer_Tools/Xcode_7.3.1/Xcode_7.3.1.dmg
I was first wandered if it could be mounted directly through hdiutil attach and looks like it could but not for everyone's accounts.
Open to see its content and copy Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/7.1 to same path into Xcode application directory.
Restart Xcode
Same issue, go to App Store and update Xcode
Get latest iOS-device-support-files (GitHub) (updated regularly). Download and copy iOS-device-support-files to:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
I have Xcode 12.4 and can't run my app on my device with iOS 14.5.1
Download Device support 14.5 from here:
https://github.com/iGhibli/iOS-DeviceSupport/tree/master/DeviceSupport
Then, Follow below steps:
XCode.app > Right Click > Show Package Contents > Contents >
Developer > Platforms > iPhoneOS.platform -> DeviceSupport
Paste 14.5 (unzipped) folder here.
Close Xcode if you have it open and quit Xcode.
Reconnect device if it was connected.
Open Xcode and build.
If this trick does not working, you have to get the versions from the new Xcode version.

Using iPhoneSimulator 8.4 SDK in Xcode 7.3.1

I've tried the method mentioned here,
How to point Xcode to an old SDK so it can be used as a "Base SDK"?
I downloaded Xcode 6.4 and located 8.4 SDK for iphone simulator.
cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
ln -s /Applications/Xcode6.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk/
Then I modified MinimumSDKVersion here in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Info.plist
Now I restart Xcode, the SDK for iPhone simulator was not present.
If I click on others and add iphonesos8.4 it says iphoneos8.4 (sdk not found
Any ideas?
Try to edit the /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform Info.plist, that way Xcode can pick up that 8.4 SDK and link against it. Then you should be able to run against the iPhone 8.4 simulator. If that still doesn't work, then forget the symbolic link and just copy the entire source SDK Folder and rename it iPhoneOS8.4.sdk

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

Adding Older iOS SDKs to Xcode 4.1 in Lion

I just installed Lion and Xcode 4.1. How do I add older SDKs so I can build and run in 4.1 or 4.2 in iPhone/iPad Simulator? Xcode 4.1 only comes with the iOS 4.3 SDK.
Does Lion have some sort of minimum SDK for builds?
Thanks,
Actually it is possible to add older SDKs as long as you can still get your hands on an older version of Xcode with the older SDK. It's useful too sometimes: when you do this you get to find out about unsupported constants and methods you may be using during compile rather than at runtime. Here's how to do it.
Get hold of an older version of Xcode with the older SDK. The Apple iOS Dev Center currently lists the 4.3 SDK with the Xcode 3.2.6 download.
Mount the dmg and open up the Packages folder hidden within the dmg via Terminal:
open /Volumes/Xcode\ and\ iOS\ SDK/Packages/
Double click the pkg file for the SDK version you want. I was looking for iPhoneSDK4_3.pkg but, in addition to 4.3, found packages as old as iPhoneSDK3_0.pkg. So perhaps older SDKs may still be packaged with the App Store download if you know where to find it (I didn't).
Let it install in it's own folder of choice since you won't be able to force it to install in Applications/Xcode.app/Contents/Developer (which is where the Developer folder is now)
You'll find the package installed in the Platforms folder in the volume you chose. Move the relevant SDK over to the Developer folder within Xcode.app. You'll likely have to use sudo:
sudo mv /Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Restart Xcode and you should see the new (old) SDK listed in your options for Base SDK. Yay!
Update as of 12 Sep 2013
If the "older SDK" you're trying to add comes bundled in Xcode 4.3 or later, adding the SDK is as simple as downloading Xcode from dev center link that says "Looking for an older version of Xcode?" (currently points here), mounting the dmg, then copying the relevant files over.
In terminal, you'd do something like this (edit for the appropriate SDK version number):
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/
For SDKs from versions of Xcode prior to 4.3, the older steps are still relevant.
I found this happens to work for getting the Xcode 5 GM to compile builds that carry the old iOS 6 UI even when deployed on iOS 7 devices. Useful for fixing bugs pending a UI redesign. That said, there's got to be an easier way to get the iOS 6 UI on an iOS 7 device.
You can't. What you can do, however, is click on the top-level entry in the File Navigator. It'll take you to the application settings. Go to the tab called Build Settings, and change the iOS Deployment Target to whatever version of iOS you'd like to support from (the earliest version you support).
See "To Edit a Build Setting…": http://developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/Building/Building.html#//apple_ref/doc/uid/TP40010215-CH9-SW5
Open Xcode and open Preferences (Xcode -> Preferences menu). Click the Downloads icon and look in the Components tab. All versions from 3.0 to 5.1 should be available. Just click Install for the ones you want to use.
None of these answers worked for me for Mac OS 10.8 and XCode 4.5. But now that things are installed under the Applications folder, it's much easier to manage.
Option #1: Keeping an older copy of XCode is easy to do by renaming it before you install the new one. Then you can use Product->Preform Action->Run Without Building on the new version to test on newer devices or newer simulators.
Option #2: If you REALLY want to build with older SDKs in the newer XCode, then you can simply copy over an SDK using finder. You'll need to have an older version of XCode installed under Applications for this to work. In the following example, I just renamed XCode 4.4 to XCode_old before I installed XCode 4.5. Note: You can right click on the .app file and choose Show Contents to get to these files or just use the cp from a terminal window.
from: /Applications/Xcode_old.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
to: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Then, iOS 5.1 will show up under Build Settings as a Bask SDK. You can do the same thing for simulators:
from: /Applications/Xcode_old.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk
to: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
You can't, but it will build fine for a device that is plugged in running an old version of iOS (what you should be conducting your proper testing on).
You have to run your application in the older version of Xcode that came coupled with the older iOS version. I have 3.2.5 installed under /Developer-3.2.5/. I have to say it's about 10 times faster than Xcode 4... You can download old versions here: http://iphonesdkdev.blogspot.com/2010/04/old-versions-of-iphone-sdk.html
I had a similar issue in Xcode 4.02 for Snow Leopard using SDK 4.3. I wanted to test on an iPhone 3G, but iOS4.2 is the latest (and correct version) for that device. In order to 'see' and run on that device in the Scheme, I had to change the Build Settings for iOS Deployment Target as described above. (btw you also have to have restrictions on the iPhone turned off to let Xcode install the app :) )
In addition to Steven's answer, you can find older versions of XCode - including the older SDKs:
Looking for an older version of Xcode?

Resources