how can I use bluetooth of Xcode simulator without any extra peripherals?

i am work with bluetooth for my app, so i want test in xcode simulator but there is no any option for start the bluetooth

Accepted Reply

I would recommend writing a BLE peripheral test injector. In other words, a class/framework which sends the CoreBluetooth peripheral rsponses to your app. Basically an internal simulator of the BLE device to which your app is supposed to interface. It is not a perfect solution but long term having an internal simulated BLE peripheral will really help with testing, writing, and debugging your code.

  • Would you please give some example code for it?

Add a Comment

Replies

As you discovered, bluetooth is not supported in the simulator. That support was removed some time ago (around 2013 if I recall correctly). You need to use a real device with the simulator if you want to test with bluetooth.

thank you for your answer, but in simulator option for blue tooth available but its disabled

I would recommend writing a BLE peripheral test injector. In other words, a class/framework which sends the CoreBluetooth peripheral rsponses to your app. Basically an internal simulator of the BLE device to which your app is supposed to interface. It is not a perfect solution but long term having an internal simulated BLE peripheral will really help with testing, writing, and debugging your code.

  • Would you please give some example code for it?

Add a Comment

Since macbooks have Bluetooth, I don't see what's the reason it's disabled in Xcode... it would be so great if we were able to test our apps using their full potential, like connecting to BLE devices. Please Apple, add this feature back to Xcode!!! :-)

  • I totally agree. But there might be a good reason. This is still a big deal!

Add a Comment