Debugging methods for Android

Debuggers

Kernel and User co-debug with GDB on Android

This presentation covers lots of Android debug resources provided by Linaro, presented by Zach Pfeffer in Spring 2012. Included is information about how to debug kernel and user simultaneously with gdb.

See Media:Zach Pfeffer Next Gen Android 2012.pdf

loggers

kernel message log

The Linux kernel has a message log in an internal ring buffer. You can access the contents of this log using the 'dmesg' command.

You can add timing information to the printk messages, by adding "time" to the Linux kernel command line.

init logging

The Android init program outputs some messages to the kernel log, as it starts the system. You can increase the verbosity of init, using the "loglevel" command in the /init.rc file.

The default loglevel is 3, but you can change it to 8 (the highest) by changing the following line in the /init.rc file. Change:

loglevel 3

to

loglevel 8

Android logging system

The Android application framework has a built-in logging system, which goes through a special driver in the kernel. It is described at:http://developer.android.com/guide/developing/tools/adb.html#logcat

Note that although the log dumper (logcat) is described on the Android developer site on the 'adb' page, there is a native logcat command included in the Android distribution (that is, available on the target file system, which can be run locally).

tracers

strace

You can use strace on Android. It is included in the Android open source project (at least as of Android 2.1), and appears to be automatically installed in engineering builds of the software.

To use strace during early initialization, you can put it in the /init.rc file. For example, to trace zygote initialization, change the following line in /init.rc.

service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server

should be changed to:

service zygote /system/xbin/strace -tt -o/data/boot.strace /system/bin/app_process -Xzygote /system/bin --zygote --start system-server

Dalvik Method Tracer

See http://developer.android.com/guide/developing/tools/traceview.html

Android Debugging的更多相关文章

  1. android Can't bind to local 86XX for debugger

    For some reason eclipse DDMS always gives the error 'Can't bind to local 86XX for debugger' every ti ...

  2. 北京联想招聘-Android Framework高级工程师(7-10年) 加入qq 群:220486180 或者直接在此 留言咨询

    Job ID #: 45038 Position Title: Android Framework高级工程师 Location: CHN-Beijing Functional Area: Resear ...

  3. Android Platform Guide

    This guide shows how to set up your SDK environment to deploy Cordova apps for Android devices, and ...

  4. Introducing Visual Studio’s Emulator for Android

    visual studio 2015支持Android开发了. Microsoft released Visual Studio 2015 Preview this week and with it ...

  5. Android开源项目收集

    软件名:gaeproxy软件作用:Android手机配置GoAgentFQ.项目地址:https://github.com/madeye/gaeproxy.git 软件名:ProxyDroid软件作用 ...

  6. Backup your Android without root or custom recovery -- adb backup

    ecently discovered a neat new way to back up apps on my Android without having to use Titanium Backu ...

  7. Android平台上优秀的开源项目

    软件名:gaeproxy 软件作用:Android手机配置GoAgent. 项目地址:https://github.com/madeye/gaeproxy.git 软件名:ProxyDroid 软件作 ...

  8. [Call Vibrator] How to Enable Outgoing Call Vibration without ROOT

    Call Vibrator requires the radio log of phone to detect when outgoing call is answered. But since An ...

  9. OnePlus安装Kali-NetHunter

    1.关于 Kali NetHunter Kali NetHunter 是一款由 Offensive Security 团队研发设计的,以 Nexus(手机/平板)为基本 硬件设备,基于原生 Andro ...

随机推荐

  1. Git代码管理心得

    一.概述: 这次按照要求进行了看似复杂,实则非常复杂并且麻烦(网上教程众多且啰嗦)的对git使用的学习,从星期六晚18:48我准备这次作业开始,直到了晚上22:44才结束电脑上的操作···(导致这篇随 ...

  2. 【codevs 1296】营业额统计 水~~

    今天下午先写一个Splay水题来复习一下Splay模板.是不是有点太水了做这种水题我有点良心不安. 可笑的是一开始我竟然WA了一组,看来是我低估水题的数据范围了,我是空节点直接返回inf或-inf,明 ...

  3. 在Linux中怎么把用户添加到组中

    (1)添加用户test,初始密码123456,该用户的主目录为/home/share,用户的基本组为root,用户的shell为/bin/tcsh,要求将该用户加到mail和new组中.请问该怎么做啊 ...

  4. str和repr的

    尽管str(),repr()和``运算在特性和功能方面都非常相似,事实上repr()和``做的是完全一样的事情,它们返回的是一个对象的“官方”字符串表示,也就是说绝大多数情况下可以通过求值运算(使用内 ...

  5. android anr分析方法

    目录(?)[+] 案例1关键词ContentResolver in AsyncTask onPostExecute high iowait 案例2关键词在UI线程进行网络数据的读写   一:什么是AN ...

  6. php中静态变量和静态方法

    1,静态变量:所有对象共享的变量成为静态变量.静态变量类似于全局变量,不过全局变量破坏对象的封装性,因此其对应于面向过程:静态变量对应于面向对象. 2,全局变量,全局变量的使用实例如下,声明全局变量时 ...

  7. centos 配置固定ip

    centos下网络配置方法(网关.dns.ip地址配置) 来源:互联网 作者:佚名 时间:07-13 00:32:07 [大 中 小] 本文介绍了centos网络配置的方法,centos网络配置主要包 ...

  8. matlab学习笔记 bsxfun函数

    matlab学习笔记 bsxfun函数 最近总是遇到 bsxfun这个函数,前几次因为无关紧要只是大概看了一下函数体去对比结果,今天再一次遇见了这个函数,想想还是有必要掌握的,遂查了些资料总结如下. ...

  9. curl模拟post请求

    1,curl -d "userType=seller&userId=1034285" "www.baidu.com/getInfo.php"  curl ...

  10. icon@font-face那些事

    http://files.cnblogs.com/files/LoveOrHate/font.rar @font-face { font-family: 'Glyphicons Regular'; s ...