原地址: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. setTimeout用法

    function faceSave() {                                    if(confirm("确定保存?"))              ...

  2. css3中定义required,focus,valid和invalid样式

    css3 提示只适用于高级浏览器: ChromeFirefoxSafariIE9+ valid.invalid.required的定义  代码如下 复制代码 input:required, input ...

  3. IOS 解析XML--使用NSXML

    一.解析文档顺序触发的函数 1.parserDidStartDocument,在文档的时候触发. 2.parser:didStartElement:namespaceURI:qualifiedName ...

  4. (转)实战Memcached缓存系统(3)Memcached配置参数初解

    一.基本参数 在我们第一次安装Memcached时,一般都是用过这个命令: memcached -m 512 -u root -d -l 127.0.0.1 -p 11211 我们先来解释这几个参数的 ...

  5. asp.net 中使用less

    首先 ,需要知道 whats the less; 实际上less 只是针对css比较难于维护和抽象这种现象,而创造的一个工具. 然后,在抛开语言环境的情况下(例如.net 是vs环境,java是ecl ...

  6. 对整站的a链接进行监控,对匹配规则进行指定页面的跳转

    项目中有个需求,就是将非本站的链接跳转到过渡页(提示即将离开本站的那种页面).这个时候想起了腾讯邮箱,不安全链接会有新的页面提示,如下图: 本以为ASP.NET中有全局的方法获取到点击或者跳转的链接, ...

  7. php 字母大小写转换的函数

    分享下,在php编程中,将字母大小写进行转换的常用函数. 1.将字符串转换成小写strtolower(): 该函数将传入的字符串参数所有的字符都转换成小写,并以小定形式放回这个字符串 2.将字符转成大 ...

  8. PHP实现冒泡算法

    <?php //php函数:count($arr)返回array的数值总数. function bubble_sort($arr){ for ($i = 6;$i > 0;$i --){ ...

  9. 如何在eclipse中配置Selenium

    1, Install python 33.(Python 27也可以) 2, Setup Selenium If you did not install Easy_install module, yo ...

  10. zhuan:ubuntu下安装Apache2+php+Mysql

    from: http://www.cnblogs.com/lynch_world/archive/2012/01/06/2314717.html ubuntu下安装Apache+PHP+Mysql 转 ...