There's a way to access the document folder in iphone/ipad (real device, no simulator)?

后端 未结 6 2065
遇见更好的自我
遇见更好的自我 2020-11-28 22:54

there\'s a way to access a real device (iphone/ipad) document folder? I realized an app that store some data in that folder and i wanted to check if all is going in the righ

6条回答
  •  天命终不由人
    2020-11-28 23:30

    You can access documents directory from code using:

    + (NSString *) applicationDocumentsDirectory {    
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
        return basePath;
    }
    

    And you can then go to terminal for the same path and check all the files.

    e.g on my system its like this:

    ~/Library/Developer/CoreSimulator/Devices/
    

提交回复
热议问题