As I'm implementing a new feature in my app which updates the database, I've come to realize that I'll be needing to copy the database to my mac for checking purposes. I'm going to follow a post in Stack Overflow that purports to do this.
http://stackoverflow.com/questions/3456613/how-to-copy-log-file-from-iphone-to-desktop-pc
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:
In Xcode, choose Window > Organizer.
// done
In the Organizer, select your device in the Devices list.
// note - click on the devices icon on the top of the display
// done
In the Summary pane, click the disclosure triangle next to your application.
Click the download button (the down-pointing arrow to the left of the Application Data package), as shown in (the figure below:)
// Note - you need to choose "applications" on the left side in order to
// get the list of applications.
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.
// Actually, in XCode 4 it's apparently a bit different. Look for the download
// arrow at the bottom of the display:
Download the file to a convenient directory. Note the file downloaded is an "xcappdata" file. Right click on select "Show Package Contents" on it. This gives you access to the files.
Note that if you're dealing with a database, then it may or may not be in there, depending on if you left it in the resources directory (non-updatable) or copied it into user documents. See http://tinyurl.com/cks54ay for info on how to do that.
No comments:
Post a Comment