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

Answered by taun in 218282022

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.

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

Accepted Answer

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.

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!!! :-)

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