Writing an App for iPad 1

by Joakim Fernstad, CTO @ CrowdCam LLC

CrowdCam
6 min readSep 8, 2016

tl;dr Totally doable, still!

At CrowdCam we love to show people their photos and for the summer we thought it would be cool to create a new product for iPad. It would be very cool if it also worked on the iPad 1!

The product is called SendFrame and it displays photos emailed to a SendFrame email address connected to the iPad app. You can find it here. It’s all very simple and it’s nothing the iPad 1 couldn’t handle, theoretically (and as it showed, practically!). However, the iPad 1 can only run iOS 5 and the latest version is iOS 5.1.1, which is a 4 year old OS version (not to mention that the device itself is 6.5 years old!!) and Apple has marked the iPad 1 a legacy device, meaning they will not support it in any way, shape or form.

There are several posts out there (e.g this and this) that help identify how to develop an app for this old OS version but they don’t provide a full solution. I found it to be easier than what they describe, although the are some hoops you need to be aware of.

First, here are the tools I used:

  • MacBook Pro running El Capitan 10.11.6 (15G31)
  • iPad 1, iOS 5.1.1 (9B206) w/ 30 pin connector
  • Xcode 7.3 (7D175)
  • Xcode 6.2 (6C131e) << Part of the magic trick

All developers can download previous versions of Xcode at Apples developer site, here (2.5GB), or go here and search for “Xcode 6.2”.

Why do we need Xcode 6.2? Because it still has support to debug an iPad 1, you just need to jump through some of those hoops to get it working.

Something about the app

As I said, our app is fairly simple. The user can create an account, choose a SendFrame email address and then view incoming photos. There are also some controls to go back and forth in the slideshow, rotate a photo and delete a photo.

There are 5 views in total and they use the regular UINavigationController to navigate between them. This is a perfect use case for storyboards.

For server requests I use a regular NSUrlConnection controlled by NSOperation. This code has worked well since iOS 4, nothing fancy.

Storyboard

Since this will run on a legacy iOS version, we can’t use shiny new storyboard features.

Storyboard settings: No Auto layout, no Size Classes and build for iOS 5.1.

You could set this storyboard to be compatible with Xcode 6.2 (“Opens in”) but it kept crashing for me with that setting so I kept it for Xcode 7.x. Which gets us to Hoop 1:

  • Use Xcode 7.3 for code, storyboard and debug on simulators.
  • Use Xcode 6.2 for debugging on device (iPad 1).

Luckily you can have both versions of Xcode running at the same time (with a powerful enough computer).

Project settings

Again because this app will run on older OS versions, we need some specific settings for the project.

Project settings

The most obvious is of course the deployment target. Type 5.1.1 in the dropdown. For iPads, we need it to require fullscreen. This is because we can’t use Auto layout in earlier versions of storyboards so the app can’t be run side by side another application (actually, I just tried it on a newer device and it works, it just won’t scale the view).

I’m not using Asset Catalogs. I don’t remember if that was an issue or not but I know those didn’t exist with iOS 5 so I’m not taking any chances.

Another thing we can’t use is Bitcode, because it’s not supported for iOS versions below 6.0.

So let’s turn that off. You find it in Project Settings > Build Settings > Build Options.

The Base SDK should be “Latest”. Assuming there are no incompatibilities in the code (e.g using iOS 9 only APIs), you should be able to compile your project without warnings or errors.

You can of course still use APIs for OS versions later than 5.1.1 but you have to wrap them so the iPad 1 does not try to execute them. It can be done with the fairly naive example code below.

Naive check for device OS version to drive code path.

On to debugging.

Debug on device

So this part was fun. Trying to run the app on device from Xcode 7.3 gives you this message in the Device manager.

Not supported.

Xcode 6.2 doesn’t really either want to run your code on an iPad 1, so it gives you all sorts of excuses. The first time you try to run on the device you’ll probably get this message.

Use for development plz

In earlier versions of Xcode there was a checkbox in the Device manager that marked the device as a development. It’s not there anymore. Nowadays you have to add the device to the proper provision profile matching your developer certificate. No biggie, you need to do this anyway. While you are at it, create an adhoc profile as well, you will need it. Xcode will still complain though. Getting to debugging from here a 3 step hoop.

First, go to the Device manager and right click on the device and select “Show in Run Destinations Menu”.

If you try to run on the device now, it will probably show you this error:

Don’t despair, this is Xcode testing your dedication.

Second, create an adhoc archive with a provision profile containing the iPad UDID using Xcode 6.2. Export it and save on disk (I assume you know how to do this). If Xcode complains about 64bit code, read this, that didn’t happen for me though.

Third, and this is the sneakiest past, drag your adhoc build from finder onto the “Installed Apps” section of the selected device in the Device manager. This should install the app on the device without issues.

Drag the app .ipa file into the “Installed Apps” section.

Now check the top in Xcode again. Does the “Run Destination” now show the name of your device instead of the generic “iOS Device”?

Tada! Magic.

Xcode 6.2 has now been tamed (for some magical reason) and will gladly run and debug your app on the iPad 1! That is, until you restart Xcode, then you’ll have to take it from step 1 again. Oh well.

Submit to app store

There are actually no hoops to jump through here. Use Xcode 7.2 and build a Release archive and upload to Apple through Xcode, like you would any other app. There is no need to use an earlier version of Xcode or the Application Loader for this. Just test your app on other devices and more recent iOS versions like you normally would before a submission.

Apple reviewed and approved our app in less than a day and the app installs from the App store without issues on the iPad 1. 😊

About the author

Joakim is the technical founder of CrowdCam LLC and writes code for iOS, servers and embedded devices. You’ll find his random tweets as @signalspy.

--

--