Q&A: iPhone 6, iOS 8 and Apple Watch

Yesterday, Apple released iOS 8 GM, presented Apple Pay, launched the expected iPhone 6 and iPhone 6 Plus and of course also announced the Apple Watch we’ve long been waiting for.

What does this mean for you as a Titanium developer? Over the course of the day(s) we hope to provide you with as many answers we can.

Please leave a comment with your questions and we’ll try to answer them. If you have answers, we’d very much like to hear from you as well of course ;)


How can I build using iOS SDK 8 GM?

You need Xcode 6 GM and Titanium SDK+CLI 3.4 RC. Builds will then use the iOS 8 GM SDK automagically. See Can I still build using Titanium SDK 3.3 or older? before overwriting your existing Xcode 5 app.

How can I make my app compatible with iPhone 6?

Icons & Launch Images

You need to add some new icons and launch images, which TiCons has experimental support for.

Image assets

For the iPhone 6 Plus you’ll need HD Retina (@3x) image assets. At 480dpi these match the XXHDPI density on Android. The TiCons CLI 0.9 has support for generating Retina, XXHDPI and lower densities from @3x images.

Lay-outs

Also, iPhone 6 means bye-bye 320dp-wide screen so you will need to check your app lay-outs and probably add new images for views that have dimensions relative to the screen size.

How do I test on an iPhone 6 Simulator?

Studio

Via Studio you can simply select it from the menu.

CLI

Via CLI you have 3 options.

1) You can look up a simulator device’s UDID and then use that with -C:

$ ti info -t ios

$ ti build -p ios -C [UDID]

2) Or you can instruct the CLI to prompt every time you build:

$ ti config ios.autoSelectDevice false

3) Even better is to trigger the prompt only when you need it by passing an invalid value for -C:

$ ti build -p ios -C ?

How do I test on an iOS 7.1 Simulator after building using iOS SDK 8 GM?

You’ll first need to install the iOS 7.1 Simulator for Xcode 6 GM. Do this via Xcode 6 > File > Preferences > Downloads.

Studio

Via Studio you can then simply select it from the menu.

CLI

See How do I test on an iPhone 6 Simulator? on how to select a specific simulator device.

You can also have the CLI auto-select any 7.1 Simulator device using:

$ ti build -p ios -S 7.1

Can I still build using iOS 7 SDK?

Yes, you can if you still have Xcode 5 (which contains the iOS 7 SDK) installed and your app uses Titanium SDK 3.3.x or older. Since Xcode 6 GM is now named Xcode.app it will overwrite Xcode 5. Just rename Xcode 5 to something like Xcode5.app to keep both installed. You do need Titanium CLI 3.4 RC for it to correctly switch between both Xcode versions.

Both Studio and CLI automatically switch between Xcode and iOS SDK versions based on the Titanium SDK you have selected in your tiapp.xml. For SDK 3.4 and later it will use Xcode 6 with iOS SDK 8, for older Xcode 5 (if found) and iOS SDK 7.1.

Apps build using the iOS 7 SDK will run fine on iOS 8 devices, but probably Apple is going to require iOS 8 SDK to publish/update apps soon.

Note: If you’re using ti.map then make sure you explicitly ask for 2.0.2 (or older). If you don’t ask for a version you’ll get the latest 2.0.3 which appears to have problems with iOS 7 SDK.

Will my apps still run on iOS 7 and iOS 6 devices?

Tests show apps build against the iOS 8 GM SDK work fine on devices running iOS 6.x or later. However, Titanium SDK 3.4 RC does not officially support iOS 6.x anymore according to the release notes. Also, you can no longer install iOS Simulators for iOS 6.x and older in Xcode 6.

Can I still build using Titanium SDK 3.3 or older?

Yes, but only using the iOS 7 SDK. See Can I still build using iOS 7 SDK?.

Why doesn’t reset the iOS 8 Simulator properties when I replace/delete an app?

Well, because of a bug Apple has to fix.

Why can’t I see the iOS 8 Simulators in Studio?

Please check the selected SDK via command-line:

$ ti sdk select

This needs to be 3.4.x in order for the Studio to find Xcode 6. You better leave this at 3.4 and use --sdk 3.x when you need to compile against an older Titanium SDK.

What new iOS8 API’s can I use in Titanium?

The first priority for Appcelerator with every new OS release is to be compatible. After that, new API’s will be added. Appcelerator no longer tries to fit everything in the core SDK, even more when it comes to APIs specific to one platform. API kits like HomeKit and HealthKit will be developed as separate (e.g. ti.homekit) modules. These might be developed and maintained by Appcelerator if there is an high demand for it, but nothings stops you from rolling your own!

Watch these tickets you have interest for to influence the priorities set by Appcelerator:

Already available:

Will Titanium support WatchKit?

WatchKit will be a new set of API’s, much like HomeKit and HealthKit. It will not be another OS next to iOS and OSX. Apps on the watch will come as extensions of apps on your iPhone, interacting with each other via this new kit. As the kit isn’t published yet, nobody can tell yet what it will take to make it work with Titanium.

The APIs can be wrapped in a stand-alone module (ti.watchkit) for sure, but the challenging bit will how a watch-app UI will be packaged with the phone-app. Probably as a new target in the Xcode project, which is also the case for the new Share/App Extensions in iOS8. This feature has been put on hold by Appcelerator, but I guess they better get to it now :)

App imagineer: Imagining, Engineering & Speaking about Native mobile Apps with Appcelerator Titanium & Alloy • Meetup organizer • Certified Expert • Titan


Comments