原地址:http://blog.csdn.net/armoonwei/article/details/7032455

目前貌似不支持断点调试,但可以通过日志打印(logcat)来跟踪。

 在android SDK中有个adb工具,使用此工具来跟踪运行的android应用:

adb logcat  

启动logcat,并将设备上运行的android应用的运行时信息全部打印出来。

adb logcat -s Unity  

如果只想打印Unity的输出信息,使用此命令。

adb logcat -d > logcat.txt  

将打印信息输出为文件。

当然,更直接的做法是在应用中集成自己的调试信息窗口,将如下代码关联到一个gameobject:

[csharp] view plaincopy
<p>using UnityEngine;
using System.Collections;</p><p>public class GuiTextDebug : MonoBehaviour
{
private float windowPosition = -440.0f;
private int positionCheck = ;
private static string windowText = "";
private Vector2 scrollViewVector = Vector2.zero;
private GUIStyle debugBoxStyle; private float leftSide = 0.0f;
private float debugWidth = 420.0f; public bool debugIsOn = false; public static void debug(string newString)
{
windowText = newString + "\n" + windowText;
UnityEngine.Debug.Log(newString);
} void Start()
{
debugBoxStyle = new GUIStyle();
debugBoxStyle.alignment = TextAnchor.UpperLeft;
leftSide = ;
} void OnGUI()
{
if (debugIsOn)
{
GUI.depth = ;
GUI.BeginGroup(new Rect(windowPosition, 40.0f, leftSide, 200.0f)); scrollViewVector = GUI.BeginScrollView(new Rect (, 0.0f, debugWidth, 200.0f),
scrollViewVector,
new Rect (0.0f, 0.0f, 400.0f, 2000.0f));
GUI.Box(new Rect(, 0.0f, debugWidth - 20.0f, 2000.0f), windowText, debugBoxStyle);
GUI.EndScrollView(); GUI.EndGroup (); if (GUI.Button(new Rect(leftSide, 0.0f,75.0f,40.0f), "调试"))
{
if (positionCheck == )
{
windowPosition = -440.0f;
positionCheck = ;
}
else
{
windowPosition = leftSide;
positionCheck = ;
}
} if (GUI.Button(new Rect(leftSide + 80f,0.0f,75.0f,40.0f),"清除"))
{
windowText = "";
}
}
}
}
</p>

android下调试unity3d应用的更多相关文章

  1. (转)<Unity3D>Unity3D在android下调试

    转自:http://blog.csdn.net/zuoyamin/article/details/11827309 一.工具准备 1.JDK——由于android是基于Java平台开发的,jdk是必须 ...

  2. android下调试声卡驱动之概述

    在Android中音频系统使用的是ALSA系统架构.ASoC--ALSA System on Chip .是建立在标准ALSA驱动层上,为了更好地支持 嵌入式处理器和移动设备中的音频Codec的一套软 ...

  3. Ubuntu杂记——Ubuntu下以USB方式连接Android手机调试

    在Ubuntu下进行Android开发,发现自己的手机就算打开USB连接.USB调试还是连不上,一直都是显示??????.百度了很多,发现都是要改“ /etc/udev/rules.d/50-andr ...

  4. 使用Monitor调试Unity3D Android程序日志输出(非DDMS和ADB)

    使用Monitor调试Unity3D Android程序日志输出(非DDMS和ADB) http://www.cnblogs.com/mrkelly/p/4015245.html 以往调试Androi ...

  5. android下vulkan与opengles纹理互通

    先放demo源码地址:https://github.com/xxxzhou/aoce 06_mediaplayer 效果图: 主要几个点: 用ffmpeg打开rtmp流. 使用vulkan Compu ...

  6. 【转】你所不知道的Android Studio调试技巧

    这篇写Android studio debug技巧个人觉得写得不错,转自:http://www.jianshu.com/p/011eb88f4e0d# Android Studio目前已经成为开发An ...

  7. 你所不知道的Android Studio调试技巧

    转载:http://www.jianshu.com/p/011eb88f4e0d Android Studio目前已经成为开发Android的主要工具,用熟了可谓相当顺手.作为开发者,调试并发现bug ...

  8. 转:RTC搭建android下三层应用程序访问服务器MsSql-客户端

    原文:http://www.cnblogs.com/delphi007/p/3346084.html android下stringgrid已知问题: 通过点击时获取对应行的值有问题,在win下调试正常 ...

  9. Android Studio调试功能使用总结【转】

    Android Studio调试功能使用总结[转]   这段时间一直在使用Intellij IDEA, 今天把调试区工具的使用方法记录于此. 先编译好要调试的程序. 1.设置断点 选定要设置断点的代码 ...

随机推荐

  1. (Android)View.getHeight或getWidth为0时的一些解决方案

    在Android开发过程中,经常需要动态的更改View的大小,有些View的大小可能需要根据其他View的大小来设定,或者你需要得到一些View的大小来进行某项操作,但是有可能你需要在onCreate ...

  2. 设置In_Memery

    alter system set inmemory_size=4G scope=spfile; alter table table_name inmemory; alter table table_n ...

  3. 事件[event]_C#

    事件(event): 1.       事件是类在发生其关注的事情时用来提供通知的方式.例如,封装用户界面控件的类可以定义一个在单击该控件时发生的事件.控件类不关心单击按钮时发生了什么,但它需要告知派 ...

  4. OpenGL5-纹理贴图

    代码下载 #include "CELLWinApp.hpp"#include <gl/GLU.h>#include <assert.h>#include & ...

  5. [GeekBand] STL与泛型编程(3)

    本篇文章主要介绍泛型算法中的变易.排序.数值算法. 一. 变易算法 所谓变易算法是指那些改变容器中的对象的操作. 1.1 copy组 template <class InputIterator, ...

  6. ▲▲▲▲▲▲▲▲▲▲▲yum源的配置(本地和ftp)▲▲▲▲▲▲▲▲▲▲▲▲▲v

    ★★★★★★★★★★★★★★★本机yum源★★★★★★★★★★★★★★★★ 1. 首先把DVD里的OS镜像mount处理,如果插入光驱自动mount的话,一般在/media下面,比如RHEL_6.3 ...

  7. 6款好用的Python IDE

    “工欲善其事,必先利其器”,如果说编程是程序员的手艺,那么IDE就是程序员吃饭的家伙了.一个优秀的IDE,最重要的就是在普通文本编辑之外,提供针对特定语言的各种快捷编辑功能,让程序员尽可能快捷.舒适. ...

  8. 锋利的jquery-validation

    jquery插件 jquery插件项目托管于gitHub,项目地址https://github.com/jquery/plugins.jquery.com jquery插件的使用 表单验证插件 现在网 ...

  9. linux find 反转 查找没有被找到的结果

    在linux下,有时候需要找一些文件,还有时候这些文件格式不够统一和规范,但是需要排除的那些文件却格式统一,就可以使用find命令的反转功能 一般用find查找文件的命令是: find . -name ...

  10. mysql table readonly

    if the table does not have primary key or unique non-nullable defined, then MySql workbench could no ...