3

I am testing some code to connect bluetooth devices on an iPhone app that works with WatchKit. As Apple watch is not out yet I need to rely on the simulator/Xcode to test it. Is there a way to simulate a bluetooth device on Xcode and link this to the iPhone simulator and WatchKit extension processes? I know how to attach the Watch app to the iPhone simulator but I am unaware of any technique to simulate BLE.

Cœur
  • 37,241
  • 25
  • 195
  • 267
mm24
  • 9,280
  • 12
  • 75
  • 170
  • No, simulator doesn't allow of use of Bluetooth now. – itsji10dra Apr 16 '15 at 16:12
  • 1
    Is there any way to use Bluetooth explorer to sniff the devices and connect it to the simulator? http://stackoverflow.com/questions/5863088/bluetooth-sniffer-preferably-mac-osx – mm24 Apr 17 '15 at 08:02

1 Answers1

2

Yes you can.

get yourself a BLE USB dongle. you need to be on OS X 10.7 and you need also to set an NVRAM setting:

$sudo nvram bluetoothHostControllerSwitchBehavior="never"
BriniH
  • 35
  • 11
  • Does this allow the iOS Simulator to detect BLE signal? – mm24 Jun 13 '16 at 13:42
  • @mm24 Yes it does – BriniH Jun 14 '16 at 14:38
  • Hi BriniH, I wonder do you know how to use my Mac Pro keyboard used as a bluetooth keyboard of simulator iPhones in Xcode? I need to handle the bluetooth keyboard input in my app, but I don't have a real magic keyboard now. – newszer Jan 10 '18 at 07:28