How to compile Xcode for device with newer iOS version

I always forget how to compile and run my apps on a device with a high OS version than the supported OS of my Xcode - here's how.

  • Download the version of Xcode which will compile to the device - I like to use xcversion to manage my Xcodes.
  • Link (or copy) the iPhoneOS device support file from the download Xcode directory to the current Xcode directory
  • Restart Xcode

Compile for an 11.1 device on Xcode 10.1

ls -s /Applications/ /Applications/  

Note: To save up disk space copy cp rather than link ln the support files. Then delete the entire folder.