Skip to content

Instantly share code, notes, and snippets.

@twobitlabs
Last active December 24, 2015 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twobitlabs/6817817 to your computer and use it in GitHub Desktop.
Save twobitlabs/6817817 to your computer and use it in GitHub Desktop.
Redirect stderr from iOS simulator to a file. Add this to your main.m. Then you can filter the output with tail -f /tmp/myapp.log | grep "foo"
#warning Don't commit me
NSString *logPath = @"/tmp/myapp.log";
freopen([logPath fileSystemRepresentation], "a", stderr);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment