Debug on iOS 12 device using XCode 9

The first question is why would you want to do it?

The answer is simple, you have a really big app and you are making new enhancements to the app and it is not feasible for you to direct resources away from the inflight projects to work on XCode upgrade, which is challenging if you are using swift as Swift has real ABI compatility issues. If you are thinking that we can simply use XCode feature to upgrade swift then your app is still in smaller size limits and you probably are not using pre-compiled dynamic frameworks either.

So, how can we Debug on iOS 12 device using XCode 9

Step 1:
What you really need to deploy code from your XCode to device is Device Support disk image under your XCode and the disk images are present in the XCode app under:


$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/

 If you run listing on the above folder you will see something like:
$ ls -ltr
total 0
drwxrwxr-x  4 root  wheel  128 Apr 27 20:20 11.3
drwxrwxr-x  4 root  wheel  128 May 12 01:51 11.4 (15F79)
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 10.0
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 10.1
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 10.2
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 10.3
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 11.0
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 11.1
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 11.2
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 8.0
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 8.1
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 8.2
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 8.3
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 8.4
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 9.0
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 9.1
drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 9.2

drwxrwxr-x  4 root  wheel  128 Jun 21 22:20 9.3

As you can see you have disk images for every OS Version but not iOS12.

So, you now install XCode 10 beta app and go to the above directory for beta
$ cd /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/


Here you find the 12.0 disk image folder and copy it over to Xcode.app device support directory
cp -r /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/12.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport


I would also rename 11.4 (15F79) to simply 11.4

Step 2:
Close your XCode and restart the same and you can now debug on iOS12 device using XCode 9.2

I am big enterprise, my company restricts access to /Applications folder
Well the reason you want to continue with XCode 9.2 is because your app is big and most big enterprise have a GIS organization that will restrict access to /Applications folder. The solution is simple, Simply copy Xcode.app from /Applications to Documents folder and you can execute the above steps on Xcode.app under Documents folder.
Note: You will have to launch Xcode.app from Documents folder to be able to deploy to iOS12 device if you are copying Xcode over as only the new location knows the right disk image libraries. 

Comments

Popular posts from this blog

Native vs Hybrid Mobile App Development

Smart Tech Jeep Order Tracking Privacy Policy