Thu 3 Jun 2010
For the past month or so I’ve been creating all my new iPhone projects using the “Universal” setting in Xcode. When doing this you are then given two essentially separate codebases to complete, one for the iPhone version of your app and the other for the iPad version. Obviously you can share code between the two but the root of each app (the “App Delegate”) is separate. I’ve been creating apps this way knowing that at some point in the future I’m going to want to upgrade them and thinking that I might as well start from the Universal app now so that everything’s ready.
Unfortunately this does mean that if I try to run these apps on an iPad, to demo to people for instance, I end up with a big white screen as I haven’t actually implemented any of the iPad specific code. This would also be an issue if I wanted to release one of these apps to the app store without writing the iPad code.
I had a quick Google around for a solution but didn’t come up with anything so I decided to have a poke about to see if I could figure it out myself. Turns out it’s quite easy.
The first thing I looked at was the Build Settings for the app, looking through I found one labelled “Targeted Device Family” which was set to “iPhone/iPad”. That seemed an obvious candidate so I changed it to iPhone and tried the app on my iPad. This loaded the app in a half-size iPhone style window but when the app loaded up I was still left with a white window and no content. Seems it was running my (non existent) iPad code in an iPhone style window. I didn’t see anything else useful in the Build Settings so I had a look at my Info.plist file. There’s a number of settings in there that seem to reference the iPad so I edited it in a text editor and prefixed all those settings with “backup-” so that they would no longer be noticed. Recompiled the app and loaded on the iPad and it worked fine.
As a bonus hint, I made my icon 72x72px even though the iPhone icons are 57px. This then worked fine and looked good on both the iPad and the iPhone. Fairly obvious really but worth knowing.
So, to recap, to convert a Universal app so that it appears like an iPhone app when run on an iPad:
- In build settings modify the “Targeted Device Family” setting it to “iPhone”
- Open your Info.plist file, ideally in a text editor, and rename the properties ending in ~ipad so that Xcode will ignore them. You could of course delete these but I wanted to keep them handy for when I do convert this to a proper iPad app in the future
- Remember to make your icon 72x72px so that it looks good on the iPad too
Disclaimer: I’m only doing this for demoing at the moment, and haven’t had any issues. I suggest you test it out for a while before submitting an app with these settings to the app store. I take no responsibility for anything that goes wrong if you try these instructions!
UPDATE – I noticed that if I don’t change the Targeted Device Family and leave it at “iPhone/iPad” you actually get iPhone style but full size and full res. Generally this can look quite odd but it’s useful to know anyway.
[...] An interesting issue I came across with this app was that I wanted to demo it on the iPad using the standard iPhone app scaling to make it bigger and easier to see from a distance. As it stood though the app was a “Universal” iPad & iPhone app, but because I hadn’t written any iPad code if I tried to run it I’d just get a big blank screen. I fiddled about though and found out how to downgrade it, having not found any information on the web about doing this I promptly blogged about it. [...]
Hey there. Great blog! I was very interested in your experiences with downgrading a universal app, but wasn’t able to follow your directions. I opened my Info.plist in a text editor, but didn’t see any values related to iPad in there. Am I looking in the wrong place? Maybe I’m using a different version of the SDK?
Would appreciate any help. Thanks!
Great info! I had a similar situation and tried changing the build target and the app simply wouldn’t load, just loaded the Default.png and hung. Anyway, I loaded up the info.plist and sure enough there are lines there loading up some ipad only .xib files. Thanks a ton!
Thanks!
This is very helpful.
Nice post! I’m in the same situation right now. I have a universal app that I want to release as an iPhone app before the iPad version is done. I found out that I had to change the target to iPhone only and I also had to remove the Main NIB file (iPad) in the info.plist. Then it opened the iPhone version on the iPad. How this will look in app store I don’t know yet (There is a plus sign if its an iPad app doesn’t it? And that would be wrong).
Thanks. This was a really great help!
Thank you!
I was having the same problem, and your solution worked like a charm. Shame Apple doesn’t have a way to make this easier…
Thanks for this post. I was wondering if you have any input on removing iPad support from a universal App that has already been submitted to the app store?
Hi Rob, afraid I don’t know anything about this. I guess you could just try it and see what happens, I can imagine Apple might not let you do it though.
John