LoginSignup
6
5

More than 5 years have passed since last update.

Flutterのデスクトップアプリをビルド&実行してみる

Last updated at Posted at 2018-12-11

Flutterすごいですね。iOS/AndroidだけでなくLinux/Mac/Windowsのデスクトップアプリも作れるようになるそうです。HammingbirdでWebもできるようになりますし本当になんでもできるようになります。
デスクトップアプリをビルドするためのリポジトリとサンプルプログラムが公開されているので試しにビルドしてみました。

Mac前提です。
先に最新のXCodeを入れておきます。

1. リポジトリをclone

# flutterのリポジトリもflutter-desktop-embeddingと並列に置く必要があります
git clone https://github.com/flutter/flutter.git
git clone https://github.com/google/flutter-desktop-embedding.git

2. XCodeでネイティブのフレームワークをビルドする

flutter-desktop-embedding/library/macos をXCodeで開きビルドする

3. プログラムをビルド

example/macos/ExampleEmbedder.xcodeproj をXCodeで開いてビルド&実行

4. ホットリロード

UIのソースは example/flutter_app/lib にある。
下記のコマンドでホットリロードしてソースの変更を反映させることができる。
ポートはXCodeのコンソールに表示される。毎回変わるようなので注意。

# example/flutter_app で実行
../../../flutter/bin/flutter attach --device-id=flutter-tester --debug-port=58460

# Shift + R でホットリロード

詳しくはここ
https://github.com/google/flutter-desktop-embedding/blob/master/Debugging.md

6
5
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
6
5