Building for newer versions of iOS from an older version of Xcode

You might have encountered this problem; a project you're working hasn't yet been updated for the most recently released version of Xcode, but your device is already running a recent version of iOS, which of course is not supported.

In my particular case, the project had a bug that only surfaced on devices running iOS 12.1. The project itself was still on Xcode 9.4, and thus used iOS 11 as it's base SDK. In such cases, Xcode will halt the build process because it can't find the support files needed to build for your device. This makes it impossible* to run and debug the application.

Of course, if time permits, you can update the project to the newer version of Xcode. In practice, this isn't always a feasible option.

There is a simple trick that has worked well for me for in the past couple of years. If you're running different versions of Xcode next to each other, including a version that does have access to the appropriate support files, you can simply copy or symlink those support files between Xcode versions. I usually choose the latter option to save some disk space.

Example

Symlinking iOS 12.1 support files from Xcode 10 to Xcode 9.4:

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/12.1\ \(16B91\) /Applications/Xcode9.4.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/12.1\ \(16B91\)  

Or copying:

sudo cp -r /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/12.1\ \(16B91\) /Applications/Xcode9.4.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/12.1\ \(16B91\)  

Note that this might have odd side effects, so use at your own peril.

Erik van der Wal

Erik van der Wal

I love building things with Swift, Objective-C, Ruby and tinkering with technologies like Golang and Elixir.

  • The Netherlands
comments powered by Disqus