1

I am using Xcode 6.1 and testing against hardware that means I cannot be plugged into Xcode while I debug. When I look at the logs for the device after I plug it back in it looks like it only shows crash logs?

Is there anyway I can divert all logs to a file in the application container then download it after plugging the device back in?

Elliot Chance
  • 5,526
  • 10
  • 49
  • 80
  • 4
    Use [CocoaLumberjack](https://github.com/CocoaLumberjack/CocoaLumberjack). – i_am_jorf Oct 29 '14 at 23:31
  • I couldn't get it to work, the docs don't describe where the log files are stored. – Elliot Chance Oct 30 '14 at 00:17
  • @ElliotChance The headers do though. But the right way to get a `DDFileLogger` file path is to get the `logFileManager` from the `DDFileLogger`, and then call the `sortedLogFileNames` method, and it'll return you all the log file paths. Header info for default path is https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Classes/DDFileLogger.h - check comment in lines 118-130. – rickerbh Oct 30 '14 at 00:36

1 Answers1

1

I know this only answers the "only shows crash logs" question, but maybe it's all you need.

Your device log, aka "console" is still there, but not in the usual place. Navigate to the "Window" dropdown menu and go to "Devices". Or more simply, press Shift+Cmd+2.

With your device connected click on your device icon and click on the small triangle in a rectangle. It will show your "device log".

enter image description here

Regarding saving the log to a file, you could use CocoaLumberjack, or do it as described in this answer.

Community
  • 1
  • 1
CaptJak
  • 3,592
  • 1
  • 29
  • 50