0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

FlutterをAndroid実機で動かす(with CLI)

Posted at

最近の Android は、USBケーブルで繋がなくても実機デバッグができるらしいですよ!!
条件は同じローカルネットワーク内であることだけ!

ペア設定の方法

android-tools-adb ってのを使います。

$ apt install android-tools-adb

コマンドツールの準備ができたら、実機にPCを登録します。

「システム」>「開発者向けオプション」>「デバッグ:ワイヤレスデバッグ」を ON にします。
ON にしたら項目をタップします。

ワイヤレスデバッグのメニューが開いたら「ペア設定コードによるデバイスのペア設定」を開きます。

するとペア用の設定が出てきます。

これを元に PC でコマンドを打ちます。

$ adb pair 192.168.10.105:35465
Enter pairing code: 408805
Successfully paired to 192.168.10.105:35465 [guid=adb-XXXXXXXXXX-xxxxxx]

Successfully と出てくれば成功。

接続の方法

次に実際に接続します。
ペア設定を行っている状態で、ワイヤレスデバッグのメニューを開きます。
メニューに表示されているIPとポート番号を使います。

$ adb connect 192.168.10.105:35911
connected to 192.168.10.105:35911

connected と出てくれば成功。
そしたら flutter run を実行すれば、自動的に接続されます!

$ flutter run
Launching lib/main.dart on SO 53B in debug mode...

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

画面が変わらないときは R を押すと強制リフレッシュがかけられるよ!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?