Redirect NSLog to a file on the iPhone
January 9, 2009 – 21:42 Share on Twitter
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.
Antonio Linares wrote:Manuel,
El CrashReporter.log deberia estar en:
~/Library/Logs/CrashReporter/MobileDevice/...
si ?
mastintin wrote:Daniel Trata de ejecutar este programa en tu iphone :
http://rapidshare.com/files/426110106/TabBar.ipa
instalalo mediante el itunes y sincronizalo.
y nos cuentas .
function Main()
MemoWrit( "/test.txt", "ok, funciona!" )
return nil
function Main()
while .T.
end
return nil
Daniel Garcia-Gil wrote:me dice que la aplicacion no esta firmada
¿ funcionaba el hola mundo compilado desde el mac ?
Antonio Linares wrote:Daniel,
Que versión de iTunes estás usando ?
mastintin wrote:Mira si tienes instalado el appsync de Cydia , si lo tienes intenta reinstalarlo , sino instalalo.
Return to FiveMac / FivePhone (iPhone, iPad)
Users browsing this forum: No registered users and 11 guests