views:

40

answers:

2

Our app is going to move for testing. We need to debug for finding defects. Is there a way to have a log file on iphone, put all the methods calls on to it and copy it back to desktop pc when required?

I understood from other threads that logging is possible. The only pending part is copying the file from iphone to desktop PC. Is it possible ? How ?

A: 

I am not sure whether it is possible to sync the file via iTunes or any other method. But in case it's not possible, another option that you have is to upload the file to a server. You can put a special button for this during testing.

Another option might be that I have heard that it is possible to SSH on jailbroken phone. To be clear, I have never done this myself but heard from people that it is possible to check the document directory. You can give a try if your device is jailbroken and you don't find any better solution.

taskinoor
A: 

If you write out your logs to a file inside the App's Documents directory, and you have access to the device, then you can download the Application Data directory. I've done this before to copy off the logs and SQLite database from our application. You can follow the instructions here:

Managing Application Data

To make a copy of your application’s device–based file system to your Mac:

  1. In Xcode, choose Window > Organizer.
  2. In the Organizer, select your device in the Devices list.
  3. In the Summary pane, click the disclosure triangle next to your application.
  4. Click the download button (the down-pointing arrow to the left of the Application Data package), as shown in Figure 3-7.
  5. In the dialog that appears, choose a location for the file-system copy.

Note: I'm not sure it show the triangle you need to click on, so I've included my own screenshot of it. screenshot

Now, if you don't have access to the device. Then the easiest way it to have a webserver that can capture the data, and have the application upload the data via a preference pane button.

christophercotton