Elliot Chance
Elliot Chance

Reputation: 5746

NSLog() on device to a file

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?

Upvotes: 1

Views: 337

Answers (1)

user2535467
user2535467

Reputation:

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.

Upvotes: 1

Related Questions