> For the complete documentation index, see [llms.txt](https://yongpenglovemimi123.gitbook.io/henry/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yongpenglovemimi123.gitbook.io/henry/ios/shu-chu-ri-zhi-xin-xi-dao-xi-tong-kong-zhi-tai.md).

# 输出日志信息到系统控制台

> 当前环境： Xcode10.0 Swift4.2 iOS SDK 12.1

Demo: <https://github.com/zColdWater/BackgroundLogDemo> (包含背后线程持续输出当前时间)

## 前言

> 这里仅仅只是记录一下这个过程，帮助也有同样需求的同学，也方便以后自己查看。

最近接到测试同学反馈的 App 的 Bug，在排查问题的时候，就需要查看手机日志。

**这里说下，只有 `Objective-C` 里面的 `NSLog` 函数才可以在系统的控制台里面输出，`Swift` 里面的 `Print` 函数是无法在系统的控制台输出出来的。**

## 过程

一， 项目中使用 `NSLog` 输出问题日志，或者其他信息。

二， 打开 Device。 ![](https://raw.githubusercontent.com/zColdWater/Resources/master/Images/systemlog_control1.png)

三， 打开控制台。 ![](https://raw.githubusercontent.com/zColdWater/Resources/master/Images/systemlog_control.png)
