LoginSignup
0
0

More than 1 year has passed since last update.

[Mac]Flutterで保存したドキュメントのpath

Last updated at Posted at 2022-01-17

iPhone

sample.dart
  void _saveFile() async {
    final documents = await getApplicationDocumentsDirectory();
    new Directory('${documents.path}/log').create().then((Directory directory) {
      print(directory.path);//ここでpath取得
      final file = File('${directory.path}/test.log');
      file.writeAsString('test');
    });
  }

普通に保存したパスをコンソール出力して
FInde上でcmd + shft + Gにて貼り付ければ飛べます

Android

Androidの場合、上述のIPhoneの方法では出来ません

[View] > [Tool Windows] > [Device File Explorer]

data/data/アプリ名/app_flutter/以下にありました。
Finderのパスですと
/Users/ユーザー名/Documents/AndroidStudio/DeviceExplorer/エミュレーター名/data/data/アプリ名/app_flutter/以下でした

人によって違うかもしれないので参考程度に

公式ドキュメント

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