原地址: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 全屏相关操作

    1.隐藏标题栏(titlebar) (1)在代码中隐藏标题栏 requestWindowFeature(Window.FEATURE_NO_TITLE); (2)在Manifest中Applicati ...

  2. sql2005导出数据字典

    右击要导出的数据库,点击 新建视图 粘贴下面代码 SELECT 表名= then d.name else '' end, 表说明= then isnull(f.value,'') else '' en ...

  3. Javascript Error: 11233 Content-Length mismatch

    Today I got a error in fiddler: Failed to obtain request body. System.IO.InvalidDataException The re ...

  4. Visual Studio 2012下Box2D开发环境设置

    Cocos2d-x 3.x默认情况下采用的物理引擎是Chipmunk,如果我们要使用Box2D引擎,需要进行一些设置和调整,而且不同的开发平台下这些设置也有所不同.由于本书在此之前介绍的都是基于微软的 ...

  5. 【leetcode】352. Data Stream as Disjoint Intervals

    问题描述: Given a data stream input of non-negative integers a1, a2, ..., an, ..., summarize the numbers ...

  6. windbg基本命令

    1, .reload k 当前调用堆栈.u 当前正在执行的代码. 2, ~ 查看被调试进程中的线程信息每一行是一个线程的信息.第一行中,0 表示这个进程的编号:1ff4.1038 是 16 进制数字, ...

  7. 对C#调用C++ dll文件进行总结

    在实际项目工作中,经常用到C#调用C++ 或者C编写的dll文件. dll支持一般函数声明和类的定义声明,但是一般为了简化,都是 采用函数声明的方式.这里主要并不是写 dll的编写. 先在vs中创建一 ...

  8. 关于fputs和fgets的几个细节

    C语言中两个标准IO fputs和fgets都是针对行来进行数据的读取的!这里关于这两个IO函数我有几个小细节想在这里和大家分享一下,希望能够对大家产生帮助! 首先贴上这两个函数的函数声明,下面以这两 ...

  9. java concurrent包的学习(转)

    java concurrent包的学习(转) http://my.oschina.net/adwangxiao/blog/110188 我们都知道,在JDK1.5之前,Java中要进行业务并发时,通常 ...

  10. DTCMS获取栏目子类

    <%set DataTable categoryList=get_category_child_list(channel,0)%> <%foreach(DataRow cdr in ...