Is there a straight forward way to “brut force” the network connection (cellular and WIFI) off and back on on an iphone? I’m working on an application that syncs through dropbox and would like to test & debug my error recovery code from lost connections.
UPDATE: I should have been a bit more specific, I want to turn this off in sw. For example after launching a request to dropbox, I want to simulate a failed download by turning off the network.
Open Settings, and turn Airplane Mode on to disable all network connections; off to re-enable.
EDIT: To enable Airplane Mode using iOS SDK (2.x and maybe 3.x), try Erica Sadun’s code: