logging - iPhone: How to read application logs from device -
is there way read application logs iphone device? similar logcat of android?
as zoul said, obtain them in organizer. prior that, should tell application store logs in documents folder, example. way when in organizer,extract application data , find logs there.
now, in order tell app redirect nslog()
outputs file, should this:
nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory,nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *filename =[nsstring stringwithformat:@"%@.log",[nsdate date]]; nsstring *logfilepath = [documentsdirectory stringbyappendingpathcomponent:filename]; freopen([logfilepath cstringusingencoding:nsasciistringencoding],"a+",stderr);
the last sentence 1 redirects output.
so once have done that, app logs stored in application's documents folder.
don't know how extract application data? here shall find out.
i hope helps out.
Comments
Post a Comment