How do I use the iPhone Simulator in 3.2 (not iPad Simulator) - iphone

I'm fixing my app to be a universal binary. Testing on the simulator seems to default to the iPad. For small corrections like checking orientations and small UI updates, the only way I can find to get the iPhone version is to plug in my iPhone and build and run on device.
Loading the debugger takes valuable time, when running on simulator is so much faster for this kind of work. Can I set the simulator to default to iPhone for this? Setting it to 3.1.3 doesn't work because of the 3.2 code I have in the binary for the iPad.
EDIT:
The Hardware -> Device, and ->Version menu choices in the simulator quits my app. When I relaunch, it goes back to the iPad. The app is not installed in the simulator

If you don't have the latest xcode, get it.
Set the project info to build for 3.2, but in the build drop down pick iPhone Simulator 4.0 and it will open in the iPhone simulator instead of the iPad simulator.

That is the dilemma: if you want to use OS 4 on the iPhone, you have to use iPhone SDK 4, which comes with XCode 3.2.3.
Previously I used iphone_sdk_3.1.3_with_xcode_3.2.1__snow_leopard__10m2003a, where the simulator was fine, but now after I update the iPhone to OS 4 (which is by iTunes), I cannot use the SDK 3.1.3 any more, and the simulator 3.2 which comes with SDK 4 actually does not work for iPhone at all!
Even when you specify the "iPhone OS Deployment Target" to "OS 3.1.3", and an iPhone-frame shows up in the iPad simulator, many functions are not responding at all.
Does Apple have an official answer to this dilemma?

I finally solved this problem myself.
First, install new version of xCode, which is xCode 4.
Then set project scheme to iphone simulator and run app in xCode several times.
And re-install xCode 3 and the problem will be gone away!

Related

Xcode 4.2.1: universal app runs on iPad but not on iPhone

I am working on a universal application where I am stuck at one point. I was able to successfully launch my application both on iPhone and iPad but since 2-3 days, I am not able to launch my application on neither iPhone nor iPhone simulator but it runs smoothly on iPad/iPad simulator.
Also when I run my app choosing iPhone device it shows message like Running the App on iPhone simulator but I am not able to see any effect on my simulator. I am using Xcode 4.2.1 and I guess the issue is pertains to the same.
I don't know whether it is a solution or not but got a way out by reinstalling the iOS Simulator.
I have faced same problem. This probably happens when you replace the application with the newScheme/EditScheme by mistake.
Just carefully check when you run your application is there your application name appear. This will be immediate left at where you choose iPhone simulator or iPad simulator version.

Why does XCode say that my iPhone app is only able to run on iPad?

I have a project in XCode with two targets. One target is for the iPhone only and the other is for iPad only.
The iPad target works as expected, but the iPhone target does not.
If I try to run it in the simulator, it starts the iPad simulator every time, but in iPhone compatibility mode with the 2x button.
If I try to run in on my iPhone 4 device, I get this message:
Can’t install application. The application at /Users/jacob/Documents/code/Projects/TVGuide/build/Debug-iphoneos/TVGuidePlus.app can only be installed on iPads.
This is XCode 3.2.6 and the iOS 4.3 SDK.
I have TARGETED_DEVICE_FAMILY defined at the target level and it looks like it is set correctly. The problem is the same for debug/release/...
have you selected the simulator as iphone?
most iphone apps are supposed to work on ipad too.
otherwise you may need to go to the project tab and go to project settings. there are some setting involving the choice of ios. i have not tried this since i havent recieved the error but i hope that it works.
Actually it turned out that I had Armv7 selected as architecture for my iPhone build. After changing that to armv6, I can now install and run the build on my device.

Jailbroken iPhone 3G with iOS 4.2.1 can't be debugged with XCode

I'm trying to debug my applications with XCode 3.2.5 and jailbroken iPhone 3G with iOS 4.2.1.
When I start debug with enabled breakpoints, application can't start (it stucks on 'Default.png' screen) and I get Data Formatters temporarily unavailable, will re-try after a 'continue'. (Can't find dlopen function, so it is not possible to load shared libraries.) message in GDB.
When I start debug without enabled breakpoints, application starts without problems.
I tried to do steps decribed there, but without any results.
When I used iOS 4.1 there was a problem with reboots.
On every connect of the iPhone Organiser displays this message:
**Unknown iOS detected** Xcode does not have debugging information for the version of iOS on the device named “iPhone”. Xcode can collect debugging data from the device to enable development with this version of iOS. This process only needs to be done once per iOS version, and will take several minutes.
Thanks for any help!
It's likely that your problem can be solved by reauthorizing your device:
If your iPhone is plugged into the computer, unplug it
In Xcode, display the Organizer (Window->Organizer)
In the Devices area click on your device and delete it.
Just in case, Quit Xcode and then re-launch it.
Open the Organizer again, then plug your iPhone into your computer.
Tell Xcode that yes, you'd like to authorize the device.
If everything works correctly, Xcode will now download device information for 4.2.1.
If this doesn't work then I suggest performing the steps again, but replace step 4 with removing all traces of Xcode from your computer and then reinstalling it. This includes the entire Developer folder.
The latest Xcode+SDK drop doesn't know about iOS 4.2.1, because it was published before the latest patch came out. Xcode's Organizer has a new feature that tries to download debug support files directly from the device, but apparently it has some (possibly jailbreak-related) issues for some people.
iOS 4.2.1 is similar enough to 4.2 that Xcode can be coerced to use 4.2 support files to debug on 4.2.1 devices. To do this, simply go to the /Developer/Platforms/iPhoneOS.platform/DeviceSupport folder and manually copy the Symbols subfolder and/or the DeveloperDiskImage.* files from 4.2 (8C134) to 4.2.1 (8C148) (or whatever release folder Organizer creates for your device).
Jailbroken 3GS / 4.2.1
I tried Matthew Frederick's recommendation without success. Anyone happened to find a solution to this problem?
EDIT
Please note that I used a jailbroken 3GS and a non-jailbroken 3GS.
Workaround, requires a non-jailbroken iPhone 3GS with 4.2.1 (8C148a):
Delete /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148a)
Connect the non-jailbroken iPhone 3GS with 4.2.1 (8C148a)
Open Xcode and Organizer
Configure the new iPhone for development by clicking the "Use for development" button in the Organizer.
Let it extract the debugging symbols from it recreating /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148a)
Unplug it, remove from Organizer
At this point you can debug your jailbroken iPhone again.
Cheers!
In order to get rid of (Re)Collecting Debug Symbols in Organizer (which in fact does nothing) each time the iPhone is presented to the XCode, a simple workaround is to copy:
DeveloperDiskImage.dmg and DeveloperDiskImage.dmg.signature
from the 4.2 (8C134) to the empty 4.2.1 (8C148) folder.
The XCode will recognize device and you'll be able to debug your code, but without debug symbols for the IOS framework.
But, the gdb console will be alive and you can use it do debug your code (with debug symbols).
Btw. you can always use Simulator for the full IOS support :-)
My completely non-Jailbroken iPhone does this with 4.2.1, and gets exactly the same messages and problems. It's new functionality in the latest version of XCode, so it may well be buggy.
Additional suggestion besides Fnord's suggestion is to make sure that multitasking, or the "Reenable Functionality" in PwnageTool is not enabled for iPhone 3G jailbroken device.
I'm not sure if this has an effect though. But, it's reasonable to do this if we really want to test it on a real world condition of iPhone 3G.

How to test iPhone app on iOS 3.1.3?

I have an iPhone app which I need to test in an older version of iOS. In the iPhone Simulator, under the Hardware->Version menu, there are the options 3.2 and 4.0. Is it possible to test the app on an older version of the iOS? If so, how do I make it happen?
Unless you kept your old build of xcode (that has the 3.1.3 simulator) or you have a device running 3.1.3 you are more than likely out of luck.

Why do my xcode builds always go to the iPad simulator instead of the iPhone simulator?

I just installed the latest SDK from Apple so I can start learning iPhone / iPad app development. However, I'm having a stupid issue: all my builds get run in the iPad simulator instead of the iPhone simulator, and I have no idea how to change it.
For now, the iPhone Simulator 3.2 SDK is iPad-only. Test using the iPhone Simulator 3.1.2 SDK
edit: as of the upcoming 4.2 SDK, the iPhone and iPad versions of iOS have been unified under a single SDK.
On your build selector dropdown, (where you select device or simulator), there's now a new option that lets you choose the "Active Executible." Choose "iPhone Simulator."
alt text http://img.skitch.com/20100227-qyadm4ktn3abr3j44upkufjieh.jpg