NSCoriolisBlog » Blog Archive » Redirect NSLog to a file on the iPhone
http://blog.coriolis.ch/2009/01/09/redirect-nslog-to-a-file-on-the-iphone/
july 2010 ‧ debug tips xcode ‧ open in karakeep
Karakeep has no AI summary for this page yet. summarize now
If you need to debug your app when disconnected from your Mac (and from the console), redirect all your NSLog calls to a file so you can later read it. The method below will create a file name « console.log » in the Documents folder of your application so you can later read it. Just call this method in your program: - (void) redirectConsoleLogToDocumentFolder { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *logPath = [documentsDirectory stringByAppendingPathComponent:@“console.log”]; freopen([logPath cStringUsingEncoding:NSASCIIStringEncoding],“a+”,stderr); } The log will never be erased, so use with caution. Once you have tested your app in the filed, reconnect your phone to your Mac and in Xcode, open the Organizer. In the Summary panel, you have the list of all the apps on your phone. Expand the one you’re debugging, and you’ll a package named « Application Data ». Click the arrow on the right of its name and ... Lire la suite…
*bookmark *download *tobuy *tofollow 2d 360 3d 3dprinting abandonware actionscript air algorithm android api app apple appstore arcade arduino art article askreddit asm audio automation backlight backup bambulab bbs berlin bitcoin blipfm blipster blog bluetooth book bookmark bootcamp brasil bug c c# c++ carro casa chiptune claudeai cocoa cocoa-touch code collection component controller css database debug demoscene design deutschland dev diy doc dos dosbox dotnet download electronics emu emudev emulation emulator example famicom feedbin fix flash flex forum freeware gadget game gameboy gamecollecting gamedev germany git GoogleReader hack hacks hardware home home-automation homeassistant homebrew howto htpc http IFTTT image imported inspiration ios iosprogramming ipad iphone iso itunes jailbreak japan java javascript lcd lib library linux mac mame math mce mediacenter megadrive midi mod mp3 mpd music mythtv nas nes objective-c opengl opensource osx pc piracy plex plugin Pocket programming ps2 ps3 ps4 pvr raspberrypi recipe reddit reddit-comment reddit-post remote repro resource retrogaming retropc retropie rgb roms rubyonrails saopaulo sdk shmups shop shopping sms snes software soundblaster source star steamdeck svn swift synology synth terminal tips tool toread torrent travel tutorial twitter twitter-post ubuntu ui uitableview unix unlock veralite viagem vista vita vpn vps walkthrough warez web2.0 webservices wii windows wishlist wordpress xbmc xbox xcode xna z80