😎
iOSシミュレーターのデータ保存場所を簡単に得るコマンド
xcrun simctl
コマンドを活用すれば、Library > Xcodeを開いて...などFinderから手動で探す必要がなく、簡単にアクセスできます。
起動中のシミュレーターIDを取得
xcrun simctl list devices | grep Booted
データコンテナのURLを取得(これがメイン!)
xcrun simctl get_app_container <deviceId> <bundleId> data
- deviceId: 前段のコマンドで取得できたシミュレーターID
- bundleId:com.mydomain.AppNameの形式のバンドルID
起動中のシミュレーターが1つの場合は下記でも取得できます。
xcrun simctl get_app_container booted <bundleId> data
取得したURLをopen
コマンドで開いてください。ディレクトリが開いて簡単にアクセスできたはずです。
AppGroupsのコンテナを取得
xcrun simctl get_app_container <deviceId> <bundleId> groups
でコンテナのURLを取得することもできます。
参考記事
Discussion