0
votes

I am developing an application with Phonegap/Cordova which should target iPhone only. I set Targeted Device Family on the project settings accordingly:

Targeted Device Family setting

However, when I run the application on the simulator, or on a test device, it still keeps opening fullscreen on iPad, while I thought it should display in a small window at iPhone resolution.

Any suggestions on how to fix this problem?

2

2 Answers

0
votes

XCode's "Target Settings" were overriding "Project Settings".

More details on this matter here: XCode Edit Project Settings vs Edit Active Target

0
votes

Actually, I've had this same problem. The fix was pretty much the same as yours but I'd like to elaborate a bit on that.

Using Xcode 4.5.1:

  1. Go Project navigator
  2. Click top item (This should be the name of your project, saying something like "1 target, iOS SDK 6.0)
  3. Click on your app name under "Targets"
  4. Then, under the tab "Summary" set the "Devices" value to iPhone (or iPad, or whatever you wish)
  5. Then click on your app name under "Project"
  6. Click Build Settings
  7. Scroll all the way down to the "Deployment" section and select the proper value for Targeted Device Family EVEN WHEN IT'S ALREADY CORRECT!

That did the trick for me. I had to "confirm" that setting again and then my trouble were over. I've seen an experienced iOS dev do that thing too a bunch of times and I thought it was a tick :) Turns out it actually has an effect sometimes. I guess the config isn't always in sync with what Xcode shows.