简体   繁体   中英

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?

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".

在此处输入图片说明

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM