如何创建和阅读在Android设备上登录? [英] How to create and read Log on Android devices?

查看:143
本文介绍了如何创建和阅读在Android设备上登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Android上尝试了我的应用,但突然运行不正常(在Windows上运行正常).当我在Android上运行设备时,是否有办法查看统一控制台的错误和Debug.Log消息?(我使用开发模式和脚本调试).

I just tried my app on Android and it suddenly doesn't work well (on Windows it works fine). Is there a way to see unity console's errors and Debug.Log messages- when I run the device on Android?(I use development mode and script Debugging).

我已将adb连接到设备,还可以使用logcat和filter来统一",但是它仍然显示疯狂的日志.

I connected adb to the device, and can also use logcat and filter to "unity", but it still shows a crazy log.

我只想看到一个干净的日志,其中显示错误和我的Debug.Log消息,这些消息通常可以在Windows上的Unity的Unity Console上轻松看到.

All I want to see is a clean log that shows errors and my Debug.Log messages which I usually can see easy and clear on the Unity Console on Unity on Windows.

推荐答案

在Android上查看日志:

要查看 Debug.Log 消息,请下载 Android Studio . 转到 Android Studio 中的 Android Monitor 标签,然后从此处选择您的设备.

To see Debug.Log messages, download Android Studio. Go to the Android Monitor Tab in the Android Studio then select your device from there.

请参见下图:

如果从设备显示的日志有问题,请从命令行重新启动 adb.exe..

If you have problems of the logs from the device not showing, restart adb.exe. from the command-line.

停止:

adb kill-server

然后重新启动:

adb start-server

我只想看到一个干净的日志,其中显示错误和我的Debug.Log 我通常可以在Unity Console上看到的简单明了的消息 在Windows上的Unity上.

All I want to see is a clean log that shows errors and my Debug.Log messages which I usually can see easy and clear on the Unity Console on Unity on Windows.

1 .首先使用Unity标签对其进行过滤.

1.First filter it with the Unity tag.

2 .从Unity Build Settings 中禁用开发模式.启用后,您将收到甚至不需要的额外日志.

2.Disable Development mode from Unity Build Settings. With that on, you will receive extra logs you don't even need.

在没有 Android Studio 的情况下在Android上查看日志:

您可以使用

You can view log from without Android Studio by using the Log Viewer plugin which is free. It will let you see the log on the device itself.

从Android Java插件打印日志:

如果您尝试从Java插件创建日志,而不使用 函数,请使用 Log 之一Java方面的功能.

If you are trying to create log from Java plugin, instead of using the Debug.Log function, use one of the Log functions from Java side.

例如Log.vLog.iLog.e.

从Android C ++插件打印日志:

如果使用的是C ++插件,请参见我的其他问题中的插件,您可以使用Debug::Log从C ++插件打印日志.

If using a C++ plugin, see this plugin from my other question which let's you print log from a C++ plugin with Debug::Log.

这篇关于如何创建和阅读在Android设备上登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆