How to test a BLE app on real phones: the device matrix, HCI logs and field logging
How I test Android and iOS BLE apps: choosing phones, HCI snoop logs in Wireshark, PacketLogger, nRF Connect and the scenarios that break apps.
Test a BLE app on the phone brands and OS versions your users actually have, not only the team's phones; run the scenarios that break BLE apps (walking out of range, locking the phone, killing the app, toggling Bluetooth, resetting the device); and capture HCI snoop logs on Android or PacketLogger traces on iOS when something fails, so you can see what the radio did instead of guessing.
Key takeaways
- Pick phones from your analytics and support tickets: brands, OS versions and the cheapest popular models.
- The HCI snoop log is the ground truth on Android; learn to read it in Wireshark.
- Compare with nRF Connect on the same phone: if it fails there too, look at the device.
- Script the scenarios that break BLE apps and run them before every release.
- Ship structured connection logs users can send; field bugs are where BLE apps really fail.
BLE bugs depend on the phone, the OS version, the radio environment and the device's firmware. An emulator has no Bluetooth radio worth testing against, and the team's own phones are usually the newest flagships, which are the least likely to fail. Here's how I test instead.
Choosing the phones
Start from data, not from what's in the drawer: your analytics, store reviews and support tickets tell you which phones users have and which ones complain. Then cover:
- Both big Android families by your users' share, usually Samsung (including a mid-range A-series) and one or two others common in your market (Xiaomi/Redmi, Pixel, Motorola, OnePlus/Oppo).
- The oldest Android version you support, and the newest. Permissions and background rules changed in 10, 12 and 14.
- At least two iPhones: an older one on an older supported iOS, and a current one.
- A cheap phone. Budget phones have slower stacks and tighter memory, and they show timing bugs first.
- Two phones at once, if your device can be used by more than one person.
My current bench: list your real test phones and dev boards, as on the About page.
The scenarios that break BLE apps
| Scenario | What it catches |
|---|---|
| Walk out of range and back | Reconnection after status 8, autoConnect, iOS pending connects |
| Lock the phone for 10 minutes, then use the device | Background limits, Doze, iOS background mode |
| Kill the app from recents, then trigger the device | PendingIntent scans, state restoration (and the force-quit rule on iOS) |
| Toggle Bluetooth off and on during a transfer | Cleanup: close(), failing pending operations, UI state |
| Airplane mode, then back | Same as above, through a different path |
| Factory reset the device, then connect | Stale bonds and the re-pairing flow |
| Update the device's firmware, then connect | Stale GATT cache, protocol version handling |
| Battery saver on | Vendor background restrictions |
| Two phones near one device | Single-connection limits, status 19, confusing UI |
| A crowded place (office, trade fair) | Interference, scan result floods, slower connects |
Android: the HCI snoop log
The HCI snoop log records every packet between Android's Bluetooth stack and the controller. It shows what really happened: whether the connection request went out, what the device answered, which side disconnected and why.
- Enable Developer options, then turn on Enable Bluetooth HCI snoop log.
- Turn Bluetooth off and on so logging starts.
- Reproduce the problem, noting the time.
- Take a bug report (
adb bugreportor from Developer options) and find thebtsnoop_hci.loginside it; the exact path varies by phone. - Open it in Wireshark.
Filters I use most. Field names come from Wireshark's Bluetooth dissectors.
| Wireshark filter | Shows |
|---|---|
bthci_cmd.opcode == 0x200d | LE Create Connection: the phone trying to connect |
bthci_evt.le_meta_subevent == 0x01 || bthci_evt.le_meta_subevent == 0x0a | LE Connection Complete (and the enhanced version), with status |
bthci_evt.code == 0x05 | Disconnection Complete, with the reason code |
btatt | All ATT traffic: reads, writes, notifications, errors |
btatt.error_code | Only ATT errors |
HCI_CMD LE Create Connection peer=XX:XX:42:1F HCI_EVT Command Status status=0x00 HCI_EVT LE Connection Complete status=0x3E (Connection Failed to be Established) // the device never answered: look at advertising and range before the app code
iOS: PacketLogger
On iOS, install Apple's Bluetooth logging profile on the phone (from Apple's profiles and logs page for developers), reproduce the issue, then capture a sysdiagnose or connect the phone to a Mac and use PacketLogger from Xcode's Additional Tools. It shows the same HCI-level detail as Android's snoop log.
nRF Connect as a referee
Nordic's free nRF Connect app is the quickest way to settle “app or device?”. If nRF Connect connects reliably on the same phone and your app doesn't, the bug is in your app. If nRF Connect fails too, look at the device: its advertising, connection limits and firmware. For radio-level questions, an nRF52840 dongle with nRF Sniffer captures packets over the air into Wireshark.
Logging from the field
Most BLE bugs are reported, not reproduced. Build the app so a report arrives with evidence:
- A structured connection log: every state change, status, timing and RSSI (format in connection drops).
- Phone model, OS version, app version and device firmware version on every report.
- A “send diagnostics” button users can find from the error screen, with consent and no personal data.
- A ring buffer on the device itself, readable over BLE, if the firmware team can add one.
Add one field bug that logs like these caught for you, and how long it would have taken without them.
FAQ
Can I test a BLE app on an emulator?
Not meaningfully. The Android emulator's Bluetooth support is limited and doesn't behave like real phone stacks, and the iOS Simulator has no Bluetooth. Test BLE on real phones; use emulators for the rest of the UI.
How do I get the Bluetooth HCI snoop log on Android?
Turn on Enable Bluetooth HCI snoop log in Developer options, restart Bluetooth, reproduce the problem, take a bug report and open the btsnoop_hci.log file from it in Wireshark.
Which phones should I test my BLE app on?
The ones your users have: check analytics and support tickets. Cover the main Android brands including a mid-range Samsung, your oldest and newest supported Android versions, at least two iPhones, and one cheap phone.
