2
2

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 5 years have passed since last update.

XCode7におけるSQLiteとかの場所

Posted at

以前自分のブログの記事にSQLiteの保存場所を探す際にShiyPholdersが便利ですよーと書いたのですが、XCode7以降まだ対応されていなかった為、自前で調べる方法をなんパターンか備忘録がてらに投稿。

PGMにDocumentRootをログに吐き出す処理を埋め込んでしまう

これが一番てっとり早いです。
AppDelegate等に以下のログを仕込んでしまって確認する方法です

swiftの場合

# if DEBUG
   print("----------------------------------");
   print("[DEBUG]");
   let documentsPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as String
   print(documentsPath)
   print("----------------------------------");
# endif

objective-cの場合

# if DEBUG
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsPath = paths[0];
    NSLog(@"----------------------------------");
    NSLog(@"[DEBUG]");
    NSLog(@"[Document Path] : %@", documentsPath);
    NSLog(@"----------------------------------");
# endif

コマンドラインで見つける場合

cd ~/Library/Developer/CoreSimulator/Devices 
find . -name "hogehoge.sqlite"  # SQLiteのファイル名

早くSimPholderがXCode7以降に対応してくれることを切に願うばかりですね。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?