Last active
November 19, 2023 23:23
-
-
Save AvdLee/7fd62be9bc8fd11de499a49205d77369 to your computer and use it in GitHub Desktop.
Easily print out useful locations for usage during debugging on the Simulator.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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