8

I wan to use the console log to resolve a bug of my application. So I view the device console log using Xcode. Problem is console log has clear the earlier logs and it shows only limited amount of log entries. Is there a way to access old log entries.

craig65535
  • 3,439
  • 1
  • 23
  • 49
nath
  • 2,848
  • 12
  • 45
  • 75
  • 1
    http://stackoverflow.com/questions/3377309/xcode-4-how-do-you-view-the-console – iPatel Sep 12 '13 at 06:11
  • Actually bug happened in the application installed in an iPad. So I wanted to access the iPad's console log using Xcode's organizer. I select the device and clicked on the console but it has limited amount of log entries. – nath Sep 12 '13 at 06:24
  • @iPatel You have added a answer to a problem of viewing console in xCode. Im having a different kind of problem. Problem is device console save limited amount of log entries (ex. last 1000 entries) in the memory. – nath Sep 12 '13 at 06:29
  • @nath have you got any solution to get old device logs? I need console log of 12 hours before but from all means, I am only able to get log of latest run. – Akbari Dipali Oct 18 '14 at 12:24
  • @AkbariDipali No I couldn't find a solution. So I redirect all logs to a file so that I can see it when I needed. So I can resolve any issues come in future – nath Oct 20 '14 at 05:18

1 Answers1

11

I found two ways to do this.

  1. Generate a sysdiagnose and AirDrop it to your computer. The sysdiagnose tarball contains a bundle called system_logs.logarchive which can be opened with Console.
  • On the device, press both volume buttons and the lock button simultaneously. Release after 1 second. You should feel the device vibrate. Note that holding down the buttons for longer than that will bring up the emergency call screen.

  • On the device, go to Settings -> Privacy -> Analytics -> Analytics Data.

  • Scroll down until you see sysdiagnose_<current date>. Select it, and tap the send button. Tap on your computer name to send the log via AirDrop.

  • On your computer, accept the AirDropped item. This will be a tar.gz file

  • Open the tar.gz file and decompress. Inside, you will see system_logs.logarchive

  • Double-click system_logs.logarchive. This should open the bundle in Console.

  1. When the device is connected to your Mac over USB, you can gather logs from it using the log tool. From Terminal, run log collect --device --output logs.logarchive. Then, open logs.logarchive in Console.

Note that Console will only show the last 5 minutes of messages by default. You can change this near the bottom of the window:

The "Showing" drop-down list

craig65535
  • 3,439
  • 1
  • 23
  • 49