macOSでflutter_blue_plusのサンプルアプリを動かす
FlutterのパッケージでiOS, Android, macOSでBLEのプラグインflutter_blue_plusを見つけたので使ってみました。
macOS向けの記事がなかったので、備忘録的な記録です。
ケースによりライセンスが必要になっていました。(2025/11/28時点)
- Free use: For individuals, organizations with fewer than 50 employees, nonprofits, and educational institutions.
- Commercial use: For-profit organizations with 50 or more employees must purchase a Commercial License. This license grants lifetime use, covers all FlutterBluePlus packages, and includes 365 days of updates.
アプリ起動
Flutterの開発環境は構築済みの前提です。
flutter_blue_plusリポジトリをクローンして、exampleアプリを起動します。
git clone git@github.com:boskokg/flutter_blue_plus.git
cd flutter_blue_plus/example
flutter pub get
flutter run -d macos
起動すると以下のようなBLEデバイスのスキャン画面が表示されます。
実際にBLE接続して、CharacteristicのREADやWRITEも動作確認できました。
BLE Adapter not availableと表示される時
flutter_blue_plusをパッケージとして使用する場合、bluetoothのEntitlementsを設定する必要があります。
Runner/DebugProfile.entitlementsとRelease.entitlementsに以下を追記すると解消されます。
<key>com.apple.security.device.bluetooth</key>
<true/>
引用元: https://github.com/pauldemarco/flutter_blue/issues/788#issuecomment-796831258
まとめ
macOSでも使用できるBLEパッケージで、BLEの基本的な動作は実現できることがわかりました。
macOSでBLEの動作確認できるアプリがないので、サンプルアプリを改良してmacOS向けアプリを作ってみたいです。

