Skip to content

Pair with libre3sim in the iOS Simulator - #30

Merged
ps2 merged 1 commit into
mainfrom
libre3sim-support
Oct 30, 2026
Merged

ps2 merged 1 commit into
mainfrom
libre3sim-support

Conversation

@ps2

@ps2 ps2 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

The iOS Simulator has no NFC and no Libre 3, so LibreLoop couldn't be paired there. This lets it pair with LoopKit/libre3sim, a Libre 3 emulator that reaches the app's Bluetooth through ImpossiBLE, the same way g7sim does for the G7.

In Simulator builds only (#if targetEnvironment(simulator)), libre3sim's HTTP API:

  • stands in for the sensor's NFC tag (LibreLoopSimulatedNFCReader, which follows Libre3NFCActivationReader's scan);
  • supplies the app credential, in place of the Arweave download;
  • supplies the key that signs its sensors' certificates, which is passed to PairingFlow as a trusted patch-signing key.

libre3sim has its own signing key and app credential; no Abbott key material is involved. Set LIBRE3SIM_URL if its API isn't on 127.0.0.1:8080. Device builds are unchanged.

Tested with next-dev Loop in the Simulator: pairing a fresh sensor through NFC activation, re-pairing a worn sensor through switch receiver, readings, a cached reconnect after a dropped link, and reconnect plus backfill after a 3-minute outage. I didn't run a device build; the #else branches are the existing code.

The Simulator has no NFC and no Libre 3. In Simulator builds only, pairing talks
to libre3sim: its HTTP API stands in for the sensor's NFC tag and supplies the app
credential and the key that signs its sensors' certificates, and Bluetooth reaches
it through ImpossiBLE. Device builds are unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant