Document directory path of Xcode Device Simulator

前端 未结 21 1738
旧巷少年郎
旧巷少年郎 2020-11-28 02:28

In iOS 7, the document directory of the iOS simulators can be found in:

/Users/Sabo/Library/Application Support/iPhone Simulator/

However,

21条回答
  •  一个人的身影
    2020-11-28 02:52

    in Appdelegate, put this code to see Document and Cache Dir:

    #if TARGET_IPHONE_SIMULATOR
        NSLog(@"Documents Directory: %@", [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]);
        NSArray* cachePathArray = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
        NSString* cachePath = [cachePathArray lastObject];
        NSLog(@"Cache Directory: %@", cachePath);
    #endif
    

    on Log:

    Documents Directory: /Users/xxx/Library/Developer/CoreSimulator/Devices/F90BBF76-C3F8-4040-9C1E-448FAE38FA5E/data/Containers/Data/Application/3F3F6E12-EDD4-4C46-BFC3-58EB64D4BCCB/Documents/

    Cache Directory: /Users/xxx/Library/Developer/CoreSimulator/Devices/F90BBF76-C3F8-4040-9C1E-448FAE38FA5E/data/Containers/Data/Application/3F3F6E12-EDD4-4C46-BFC3-58EB64D4BCCB/Library/Caches

提交回复
热议问题