16

XCode now keeps the logs from the previous runs handy which is great.

enter image description here

Is there a way to search though all of the logs.

My use case is I have seen a particular error but cant remember which run it was in. I need to find the error URL from the logs.

1
  • I can do a custom search from within XCode on a folder... Just a case of finding the logs folder now!
    – Robert
    Dec 13, 2012 at 14:48

3 Answers 3

36

Xcode stores debug logs at

~/Library/Developer/Xcode/DerivedData/<YOURAPP>/Logs/Debug/

The .xcactivitylog files are actually just gz archives. Decompress them:

cd ~/Library/Developer/Xcode/DerivedData/<YOURAPP>/Logs/Debug/
EXT=".xcactivitylog"
for LOG in *.xcactivitylog; do
    NAME=`basename $LOG $EXT`
    gunzip -c -S $EXT "${NAME}${EXT}" > "${NAME}.log"
done

Now you can easily search them using grep or Spotlight or what your prefer.

1
  • Thanks a lot! Saved me couple of hours!
    – art-divin
    May 8, 2013 at 13:36
2

To add onto @DrummerB answer. Once the files are unziped you can do a search with custom scope from within XCode. I prefer this to grep or spotlight.

enter image description here

enter image description here

enter image description here

1

The folder where these logs are is

~/Library/Developer/Xcode/DerivedData/[YOURAPPID]/Logs/Debug/

You can open/read/search them for example in TextWrangler.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.