r/iOSProgramming • u/unpluggedcord • 3d ago
Article Connecting two iOS simulators over BLE (or connecting a simulator to a real BLE device)
https://kylebrowning.com/posts/ble-between-two-simulators/
7
Upvotes
0
u/Spare_Lychee_8755 1d ago
Nice writeup, the loopback shim is a clever way to get past "one simulator, no radio." The pattern generalizes badly in one direction though: anything where the simulator fakes the sensor rather than the transport still lies to you. CoreLocation is the worst offender for me, since a GPX route in Xcode moves CLLocation but never produces real CLHeading or CoreMotion behavior, so compass and geofence logic passes in the sim and falls over on a phone in a parking lot. I ended up doing that part on a real device over USB with Waypoint instead of trusting simulator routes. https://waypointapp.dev
1
3
u/ThatGuy739 3d ago
Neat. Two things I'd still test on hardware after adopting this: MTU and the denied path.
Real BLE negotiates an ATT MTU, and maximumWriteValueLengthForType: is the ceiling you actually get. A loopback TCP link has no such ceiling, so a write that sails through the shim can truncate on a device.
And CBManagerStateUnauthorized only really shows up when someone denies the permission prompt. If the shim never produces that state, the denied branch is the one you ship untested.