iPhone simulator - simulate 3G connection - iphone

I am testing the Reachability api, but my physical device only has WiFi access, as I don't have a phone contract. My code needs to distinguish between being connected to 3G/2G or WiFi. Is it possible to simulate a 3G connection on the iPhone simulator?
Clarifications: I am using Snow Leopard. Limiting the bandwidth is not what I need. I need for the actual interface to be identified as the 3G or 2G radio, as opposed to WiFi.

If you are using Lion try the Network Link Conditioner
Nowdays there is a part in Preferences on the device (when registered as a developer device) where a "Network Link Conditioner" is available.

You might also like Speed Limit.
Edit: I'm not sure if this will work as an identifier for 3g though. I'll update my answer after I do some tests (I'm working on exactly the same thing right now!)

I dont think that it is a build-in-functionality in iphone-simulator. But I test it sometimes on my device with wifi (and 3g) disabled.
If you dont have an iPhone but sth. similar (Android for instance) then just enable tethering on your device and use the tethered internet-connection. Then your iPhone-Simulator only gets slow speed ;)
edit: another idea is to limit the bandwidth of your mac. I found this tool online (have not tested it) which should be able to limit network-traffic (to your local router/modem)

Related

Change connection to 3G or EDGE for testing slow internet connection

I am developing an app that needs to be debugged under a slow connection. My issue is that I only own an iPhone 5 that uses LTE. I can disable LTE in my Settings for a 4G connection but this 4G connection is still to fast for my testing purposes. I would like to know if there is a way to programmatically force the testing iPhone into 3G or EDGE.
You'll want to test flaky in addition to just going slow - you can simulate this with apple's network link conditioner and running your iPhone through your mac's internet connection (or run simulator). See Installing Apple's Network Link Conditioner Tool .
If you really want some good testing, the best way to do it is look up your cell provider's coverage map and find some crappy locations. Test in those areas while driving in and out of range should weed out any broken network code you have. :)
Network Link Conditioner also exists on the device in recent iOS builds, i'm not positive of when they added it.
But its present in Settings, under the Developer menu.
I can disable LTE in my Settings for a 4G connection but this 4G connection is still to fast for my testing purposes
LTE is (a kind of) 4G.
If you disable it, it will fall back to EDGE. Alternatively, you may switch to a Wi-Fi connection and slow it down (if your router has such a feature).

Private API to toggle wifi and 3G

I'm working on test automation for an app. I'm looking for a way to automate connectivity tests. For that I need to be able to toggle 3G and wifi. I've been going through the private api headers but I haven't found a method that would scream 'I do that!'.
Can anyone point me in the right direction, please?
I can't see this being possible. The iPhone 4 has a setting for 3g on or off in iOS 5, but the iPhone 4s doesn't. If it was possible to turn off 3g in the iPhone 4s I think Apple would have retained that ability in iOS 5.
I assume you've seen the reachability sample code
Thinking about this laterally, iOS connects to known WiFi hotspots when available - so you don't necessarily have to run this on the phone. You could just toggle your WiFi hotspot which you're connecting to on/off, and iOS should automatically switch (as long as any other known WiFi access points aren't in range) to 3G and WiFi respectively.

Is iphone simulator geolocation features working with the Ethernet/Wired network connection only?

I'm trying to develop an iPhone application which uses the geolocation libraries. Is this feasible for the iphone simulator to simulate the GPS functionality without the use of my PC's Wi-Fi infrastructure? Does anyone know if the iphone simulator can spot your location using your IP-address only (so only the Ethernet cable connection is required)?
Thanks in advance.
You should test that functionality on an actual device. I believe the simulator will always show Cupertino, CA as the location.
No it won't work using ethernet. Core location appears to only work with WIFI even though at the end is the same router.
CoreLocation doesn't work in the simulator, but there are options
http://github.com/futuretap/FTLocationSimulator
Simulator doesn't have this functionality, but iSimulate has (it's not mine :-( ). It connects the device and simulator per WiFi and sends location events to the application within simulator: real GPS events and a few predefined locations around the world. Pretty cool!

iPod touches cannot find each other through GameKit

I have two physical iPod touch devices. If I try running a program that uses a GKPeerPickerController to find another iPod touch running the same program, they just stay at the peer picker screen without any progress. Both have bluetooth enabled. I have tried my own program, along with Apple's GKTank sample app. Neither of the iPods seem to be able to detect bluetooth devices, such as computers in discoverable mode... could this have anything to do with it?
I was able to fix this problem by restoring the software on the older iPod. I wonder if jailbreak may have caused this issue?
A couple assumptions are throwing you off:
The GameKit Bluetooth stuff runs its own protocol, which doesn't involve traditional Bluetooth pairing or discoverability.
The simulator doesn't support connecting to devices via GameKit, so you need to test this with two real devices (or two computers, as the simulator will run the GK protocol over your current TCP connection [ethernet, wifi, etc]).
The Bluetooth bring-up of TCP/IP and Bonjour is really slow, so your first connection will often take upwards of 30 seconds to do any discovery. Even then, it seems flaky to me.
Jailbreaking your iPhone puts everything in play. You should expect stuff to not work, and be grateful if/when it does.
Gamekit only work on second generation iPod Touches (and iPhone 3G and 3GS). You didn't say whether what version your touches are.
I have been getting this error throughout the development of my game. It also leads to other problems when trying to reconnect to another game as the peer picker takes ages to connect so users get impatient. Apple needs to work on getting this more reliable.
I have restored my ipods now so will be interested to see the outcome.

Accessing Bluetooth via Bonjour/GameKit from the iPhone SDK simulator (circa 3.1.3)

I'm in the process of getting hardware for an iPhone prototype, and I'm wondering if it's possible to access bluetooth (ExternalAccessory, Bonjour or GameKit) exposed by development box (eg. a macbook) using the SDK's simulator as of the latest version (3.1.3 at the time of writing)
Before I get any answers on the subject, I accept that I will need an iPhone for the actual development - this is simply a prototype.
I'm not sure I understand your question entirely.
I can state that in iOS (as of May 2011) the only access you have to bonjour is through the Gamekit functionality. That functionality is fairly robust, but (for instance) you will not be able to create a BT based bonjour service that other non-iOS BT enabled devices can find.
On the simulator, even if the underlying device HAS bluetooth capabilities, you will NOT be able to perform "real" bluetooth operations. Instead the simulator will simulate some capabilities, and ignore others. You really do need multiple devices to load your code onto and run, in order to test out BT code.
Bluetooth connectivity is inaccessible using the Simulator. If WiFi is good enough for you, that works with Bonjour and GameKit on the Simulator as well. Otherwise, just like for the accelerometer and several other components of the device, you will need an actual device.