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. 每天一个linux命令(27):ln 命令

    ln 是linux中又一个非常重要命令,它的功能是为某一个文件在另外一个位置建立一个同步的链接.当我们需要在不同的目录,用到相同的文件时,我们不需要在 每一个需要的目录下都放一个必须相同的文件,我们只 ...

  2. [转]ORACLE 中ROWNUM用法总结!

    原文地址:http://www.itpub.net/thread-824147-1-1.html 对于 Oracle 的 rownum 问题,很多资料都说不支持>,>=,=,between ...

  3. spring c3p0数据库连接池连接配置

    c3p0连接池配置 xml文件内容如下: C3P0 通过这些属性,可以对数据源进行各种有效的控制 lc_biz_datasource_c3p0.properties 配置: lc_biz_dataso ...

  4. 【bzoj1036】 ZJOI2008—树的统计Count

    http://www.lydsy.com/JudgeOnline/problem.php?id=1036 (题目链接) 题意 动态维护树上两点间最大权值和权值和. Solution 裸树链剖分. 这一 ...

  5. codevs1064 虫食算

    题目描述 Description 所谓虫食算,就是原先的算式中有一部分被虫子啃掉了,需要我们根据剩下的数字来判定被啃掉的字母.来看一个简单的例子: 43#9865#045    +    8468#6 ...

  6. C++ Standard-Library Random Numbers

    Extracted from Section 17.4 Random Numbers, C++ Primer 5th. Ed. The random-number library generates ...

  7. ORACLE RAC集群的体系结构

    RAC是一个完整的集群应用环境,它不仅实现了集群的功能,而且提供了运行在集群之上的应用程序,即Oracle数据库.无论与普通的集群相比,还是与普通的Oracle数据库相比,RAC都有一些独特之处. R ...

  8. 静态内部类和Lazy<T>优雅实现单例

    public class Singleton { private Singleton() { } public static Singleton GetInstance() { return Conc ...

  9. C# Attribute 特性 学习

    一.特性的概述 公共语言运行库允许您添加类似关键字的描述性声明(称为特性 (Attribute))来批注编程元素,如类型.字段.方法和属性 (Property).属性与 Microsoft .NET ...

  10. svn代码回滚命令

    代码回滚提交: 比如要把73回滚到68 svn merge -r 73:68 http://my.repository.com/my/project/trunk 然后commit就行了 svn com ...