Created
December 3, 2015 12:03
-
-
Save mgamer/63207d324306dec8a056 to your computer and use it in GitHub Desktop.
symlink to ios simulator documents directory
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
#if TARGET_OS_SIMULATOR | |
NSString* homeDirectory = [[NSProcessInfo processInfo] environment][@"SIMULATOR_HOST_HOME"]; | |
NSURL *documentsDirectory = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; | |
NSString *documentsDirectoryPath = documentsDirectory.path; | |
NSString *simlinkPath = [homeDirectory stringByAppendingFormat:@"/Desktop/SimulatorDocuments"]; | |
unlink(simlinkPath.UTF8String); | |
symlink(documentsDirectoryPath.UTF8String, simlinkPath.UTF8String); | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment