2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

AndroidStudioのFlutter環境でログ/Printが出ない時

Last updated at Posted at 2021-02-14

#FlutterProject作って実機デバックしたけどPrint文がでない

たとえば、以下のようなコードでプレスイベント時にIDEのコンソールに何か文字が表示したい時。

onPressed: () => print("hogehoge")
onPressed: () => debugPrint("hogehoge")
onPressed: () => log("hogehoge")

AndroidStudioでLogcatを参照できれば表示されるかもですが、
私の環境ではLogcatが表示できなかったので (FlutterProjectだとgradleの設定に一手間必要でめんどくさかった)
手っ取り早く ターミナルで「 flutter logs 」を実行し表示できました~。

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?