Reputation: 16327
Is there any way to save all the console messages to a file in iphone ?
Thanks
Upvotes: 0
Views: 388
Reputation: 512
Copy and paste to a text editor also works, and lets you select just the parts of your current interest.
Upvotes: 0
Reputation: 81868
They go to the system log. You can see it from the organizer in Xcode.
If you really need the file, you can redirect stderr:
NSString* myLogfile = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"log.txt"];
int fd = open([myLogfile fileSystemRepresentation], O_RDWR | O_CREAT, 0664);
dup2(fd, 2);
Upvotes: 2