以前自分のブログの記事に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以降に対応してくれることを切に願うばかりですね。