Unity 中log位置以及取出方式
1:Windows以及MAC上取编辑器log文件以及正式打包出的 .exe和.app的文件
Open Player Log 表示正式包的log文件地址.
Open Editor Log 表示当前Unity编辑器的log文件地址.
2: Android Studio连接手机直接展示出log,adb连接导出log信息,C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\monitor.bat 双击打开一个监视面板,需要配置Android的相关SDK,NDK,JAVA的环境变量.
adb -s deviceName logcat -s Unity -f c:\unity_log.txt
-s deviceName 表示手机唯一标识码, -f后面表示取出log存放的位置.
3: iOS的log取出方式.
使用xcode取出log.
通过Window->Devices and Simulators,打开Devices and Simulators界面,选择我们的手机,点击view device logs能看到手机中运行的进程输出的日志
mac电脑上面 安装 libimobiledevice
brew install --HEAD libimobiledevice
在命令行输入:idevicesyslog
查看我们想要的日志
1)将设备日志重定向到文件
idevicesyslog >> iphone.log &
该命令是将日志导入到iphone.log这个文件,并且是在后台执行。
2)用tail -f和grep查看log
tail -f iphone.log
tail -f iphone.log | grep 'QQ' # 查看包含QQ的行
控制台查看log
爱思助手直接导出log日志.