views:

1023

answers:

1

Is there any way to simulate airplane mode in the iPhone Simulator?

+5  A: 

Turn off your network connection on the Mac.

Rob Napier
so obvious i kicked myself. but at the same time, surely they could have made a better solution!
benlumley
It's harder than it sounds, though our team has asked Apple for similar functionality. The problem is that apps running in the simulator are really Mac apps. The iPhone Simulator doesn't emulate the iPhone; it's just an environment for Mac apps to link against and *look* like an iPhone. So you need a way, at the system layer, to restrict an app from talking to the network. Unix doesn't provide that; it would almost certainly need kernel support to get it. You could do it more easily for NSURLConnection and its kin, but it could be more confusing if some calls work and some don't.
Rob Napier
This does not simulate airplane mode...as the GPS simulator still functions but does not return a value.
Jann