2

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.

Community
  • 1
  • 1
Richard Szalay
  • 83,269
  • 19
  • 178
  • 237

2 Answers2

0

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.

software evolved
  • 4,314
  • 35
  • 45
  • The second party of your answer is what I was looking for. – Richard Szalay May 10 '11 at 06:31
  • Sorry I couldn't give you better news! On the plus side, the Gamekit capabilities make BT very easy to use. One feature which isn't too well documented is that you can have multiple BT sessions open on each device. – software evolved May 18 '11 at 14:54
  • You are blatantly wrong regarding having no access to Bonjour: `NSNetService` and hence Bonjour is available since iOS 2.0. See documentation. I believe that in your second paragraph you wanted to say "Bluetooth" in place of "Bonjour", but for a long time now, any use of local Bonjour also enables P2P connectivity over Bluetooth. Only in iOS 5 by default Bonjour no longer enables P2P connectivity over Bonjour-over-Bluetooth. – Ivan Vučica Nov 27 '11 at 15:39
  • Ivan, sorry I wasn't clear. You can (of course) write code that accesses Bonjour through NSNetService, but that's like saying you have access to Google API because you can use HTTP -- I was speaking of having no access to a high level Bonjour framework on iOS, except through GameKit. An open source package that is compatible with Bonjour is JmDNS, which is what I use in my project. – software evolved Feb 09 '12 at 16:20
0

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.

Ivan Vučica
  • 9,529
  • 9
  • 60
  • 111