Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chosa91/430166994d0ca541094285c1799819ac to your computer and use it in GitHub Desktop.
Save chosa91/430166994d0ca541094285c1799819ac to your computer and use it in GitHub Desktop.
Easily print out useful locations for usage during debugging on the Simulator.
extension FileManager {
/*
Prints out the locations of the simulator and the shared group folder.
This is useful for debugging file issues.
Example usage: FileManager.default.printFileLocations()
*/
func printFileLocations() {
let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
let simulatorFolder = paths.last!
let appGroupURL = containerURL(forSecurityApplicationGroupIdentifier: "group.com.your.app")!
print("Simulator folder location: \(simulatorFolder) \n App Group Location: \(appGroupURL)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment