Working with Catalina, Xcode 10, Xcode 11 and multiple Titanium SDKs

Jason Kneen
Jasonified
Published in
3 min readOct 8, 2019

--

I took the plunge and updated to Catalina last week (and the final release yesterday) and also Xcode 11, which has some breaking changes around simulators and builds that doesn't affect most developers unless you’re working with old versions of Xcode.

If you’re working with the Titanium SDK, you’ll no doubt be working on projects that could be using a 7.5.X SDK and others that use the latest 8.2.0.GA SDK.

Trying to support clients on multiple SDKs can be hard, especially when for some reason you can’t update them to the latest versions.

My situation is that I’m working on new apps and projects using Titanium 8.2.0.GA but I still need to support projects running 7.5.x.GA so have to be able to work with both. I also want to be able to test on iOS 13 SDK of course.

So after some messing around, I’ve got a setup that’s working so here’s how to run Xcode 10 and 11 side-by-side and support 7.5.X and 8.2.X Titanium apps.

Firstly, all of this is non-official and non-supported but it’s all easily reversable.

So assuming you only have XCode 10 installed, here’s what you do:

  1. rename your Xcode.app in /Applications to Xcode10.app
  2. Download and install Xcode 11 from the AppStore
  3. Launch Xcode 11 and let it install the components it needs
  4. At this point you can work with Xcode 11 using the 8.2.0.GA SDK and install to the iOS 13 Simulators without any issue.
  5. Now, go to your 8.2.0.GA folder in ~/Library/Application Support/Titanium/mobilesdk/osx/8.2.0.GA and copy the ioslib in node_modules.
  6. Next, go to your 7.5.x.GA folder in ~/Library/Application Support/Titanium/mobilesdk/osx/7.5.x.GA and paste the ioslib folder you copied into node_modules, replacing the one there. You can of course rename the existing one as a backup. (You could of course just update the package.json file in the root of the SDK folder and do an npm update but that didn’t work for me.)
  7. Now go back to Xcode 11 and into preferences > components and install the 12.2 simulator. Note you can’t do this in Xcode 10 on Catalina due to system read-only partitions.
  8. Once you’ve done all you should have simulators setup for 12.2, 12.4 and 13.1.

Using the CLI you can now build an app for iOS 13 SDK (with 7.5.x or 8.2.x) using:

ti build — platform ios — device-id 1

(and select the device from the list)

To build with the iOS 12 SDK you’d use:

ti build — platform ios — device-id 1 — ios-version 12.4

(and select a device from the list of 12.2 devices)

If you want to be able to use the 12.4 list of simulators, you can but you need to do one more little “hack”.

Go back to the SDK folder and open 7.5.1.GA/node_modules/ioslib/lib/simulator.js

then comment out line 475:

// return callback(new Error(__(‘The specified iOS Simulator with the UDID “%s” is not available.’, simHandle.udid)));

Save it and then you can now select 12.2, 12.4 or 13.1 simulators!

It’s not ideal — ideally we want this patched in the 7.5.X SDK but it’ll enable you to move forward with iOS 13 SDK testing, SwiftUI etc. while still supporting apps that are written for pre Titanium 8.2.0.GA SDKs.

(If you want to revert everything, just delete the 7.5.1.GA folder and re-install the SDK.)

--

--

Freelance Cross-Platform Native App Dev • Speaker/Author • Co-host of @thecheckedshirt & @titaniumtalkfm • @Tardisloo • @appcdev Titan • Dad of 5 • Silent K.