Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One XCode project, two target, two apps (iPhone/iPad) not universal app

We have an XCode project that was first build as an universal app, and then on the road we changed our mind on having the two app in the same binary, so we created two targets.

  1. The first one is called: AppName and is for iPhone: the base SDK is 4.2 and deployment target is 3.1.3. Targeted Device is iPhone.
  2. The second is called: AppNameHD and is for iPad: the base SDK is 3.2 and targeted device is iPad.

It's been a few weeks now we are easily building for each of those platform and able to deploy on the both iPad and iPhone.

Now we are ready to submit to the app store and i'm worried about potential rejection of the code. We want to submit the iPad only app for now, but i've looked around there is nowhere in the itunesconnect site i can specify the targeted device, and as the project was structured first to be an universal app. I'm wondering how they determine on which device to test the binary.

More informations about the architecture: We are using the default generated info.plist file for both targets. Should we have a separate info.plist for each of the target? what differences should be present between the two .plist files.

Here is attached the actual info.plist file we are using.

Thanks for your help in advance.enter image description here

like image 419
clide313 Avatar asked Feb 09 '11 15:02

clide313


People also ask

How do I get multiples of the same app on iOS?

Tap and hold on the app, then drag it to the left edge of the screen and drop it onto a Home Screen. Repeat this process as many times as you like to create as many duplicates as you need.

What is the difference between project and target in Xcode?

An project is a repository for all the files, resources, and information required to build one or more software products. A target specifies a product to build and contains the instructions for building the product from a set of files in a project or workspace.

What is aggregate target Xcode?

An aggregated target is an Xcode target that lets you build a group of targets at once. It doesn't have any Products itself, like an app for an app target or a framework for framework targets. It doesn't have build rules either, but it can have a Run Script build phase or a Copy Files build phase only.


3 Answers

First of all, there's no reason why your base SDK for the ipad only target should be 3.2. In fact, since iOS 4.2 runs on ipad, you're going to limit your customer base by not changing the base SDK to 4.2. You can set your target OS to iOS 3.2 to make sure the app will run on iOS 3.2.

In your target configuration build settings, look for "targeted device family", that will say whether or not the target is "ipad", "iphone" or (for universal apps) "iphone/ipad".

I also migrated a universal app to two separate targets -- it was not fun. You have to very carefully check your build settings and your .plist files to make sure they're sane for their intended target device, especially check:Base SDK, iOS deployment target, targeted device family, and Info.plist file

like image 93
Bogatyr Avatar answered Sep 19 '22 17:09

Bogatyr


Should we have a separate info.plist for each of the target?

  • Yes.

What differences should be present between the two .plist files?

  • Bundle identifier (e.g., com.example.app for iPhone/iPod and com.example.app-hd for iPad)
  • (optional) icon (different for iPhone, iPhone @2x and iPad)
  • (optional) Launch image (different for iPhone, iPhone @2x and iPad)
  • (optional) Supported interface orientations (in my experience, at least 2 orientations for iPad)
like image 28
ohho Avatar answered Sep 20 '22 17:09

ohho


Apple uses your Info.plist to determine the target(s) in itunesconnect.

Looking at your screenshot I think you just need to make sure you do not specify the NSMainNibFile~ipad an UISupportedInterfaceOrientations~ipad in the iPhone target and visa versa for the iPad target (i.e. do not include iPhone specific entries). BTW, opening the Info.plist in Xcode provides much more descriptive names for the keys and also provides a dropdown for the allowed values.

Also be careful with UIRequiredDeviceCapabilities i.e. as a general rule only include a key in your plist if it's absolutely needed.

like image 45
loafoe Avatar answered Sep 17 '22 17:09

loafoe