2

I am using the Device tab in Xcode to view the content of my app. Here is what I see:

enter image description here

The app has iTunes file sharing enabled:

enter image description here

However I am unable to see the App in iTunes (under my Apps) even after synchronising the phone.

I am wondering if there is an alternative way to access the "test-data.csv" file that my app is generating.

XCode does seem only to list the file but does not allow me to click on the file to open it.

EDIT:

This is the file path I use:

   NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:@"test-data.csv"];
mm24
  • 9,280
  • 12
  • 75
  • 170

3 Answers3

2

As you are using iTunes sharing. You will be able to see the data in iTunes only. Make sure that you are selecting your device first in the iTunes and then going to Application tab. If you are not seeing the apps there, this means your app might be showing in the sharing section. Scroll down a bit and you will see the File Sharing section-> Apps. See if you are able to find your application there.

Hope you might get your app there.

See the screeshot:- File Sharing

Sabby
  • 2,586
  • 2
  • 27
  • 41
1

Are you sure you are saving your data in the public folder of your app and not in the private one?

Public folder:

func getDocumentsDirectory() -> NSString {
    let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)
    let documentsDirectory = paths[0]
    return documentsDirectory
}

Private folder:

func getLibraryDirectory() -> NSString {
    var paths = NSSearchPathForDirectoriesInDomains(.LibraryDirectory, .UserDomainMask, true)
    let libraryDirectory = paths[0]
    return libraryDirectory
}
Marco Santarossa
  • 4,058
  • 1
  • 29
  • 49
  • The problem I got is that I am not finding the app in iTunes. So I am unable to verify this. – mm24 Aug 09 '16 at 10:26
  • PS: I added the file path to my quesiton – mm24 Aug 09 '16 at 10:27
  • Try to unplug and plug again the device to check if osx or the device needs some permission to read the data. Check to have a right version of iTunes for your iOS version as well – Marco Santarossa Aug 09 '16 at 10:35
  • @mm24 try using https://imazing.com, this allow you to see every apps and folders in your device. If you are not able to see your app it is a issue if permissions. – Marco Santarossa Aug 09 '16 at 11:00
0

You can send this file by attaching with email and then download from your email on other desktop etc.

MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
    mailer.mailComposeDelegate = self;
    [mailer setSubject:@"CSV File"];        
    [mailer addAttachmentData:[NSData dataWithContentsOfFile:@"PathToFile.csv"]
                     mimeType:@"text/csv" 
                     fileName:@"FileName.csv"];
    [self presentModalViewController:mailer animated:YES];
Sukhpal Singh
  • 672
  • 1
  • 12
  • 31
  • I would like to avoid using emails to send this data. I simply want to browse the data files that are in my app using iTunes (Apple supports this). – mm24 Aug 09 '16 at 11:42