Quantcast
Channel: Is there any way to see the file system on the iOS simulator? - Stack Overflow
Viewing all articles
Browse latest Browse all 13

Answer by marc-medley for Is there any way to see the file system on the iOS simulator?

$
0
0

For Swift 4.2 and higher, print an easy to use path:

#if targetEnvironment(simulator)    print("::::: SIMULATOR :::::")    if let documentsPath = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first?.path {        print("App Documents Directory:\n\(documentsPath)\n")    }#endif

... in a source code location such as:

func application(    _ application: UIApplication,     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {    // ...    return true}

Use the resulting path with cd or open on the terminal command line. Or, paste the path in the shift-cmd-G"Go To Folder…" Finder prompt.

Related answer which includes older language versions: Document Directory Path of iOS 8 Beta Simulator


Viewing all articles
Browse latest Browse all 13

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>