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 More articles about

  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. Beijing Lenovo recruitment -Android Framework Senior engineer (7-10 year ) Join in qq Group :220486180 Or right here Message consultation

    Job ID #: 45038 Position Title: Android Framework Senior engineer 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 Support Android Developed . Microsoft released Visual Studio 2015 Preview this week and with it ...

  5. Android Open source project collection

    The software name :gaeproxy Software functions :Android Phone configuration GoAgentFQ. Project address :https://github.com/madeye/gaeproxy.git The software name :ProxyDroid Software functions ...

  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 Excellent open source projects on the platform

    The software name :gaeproxy Software functions :Android Phone configuration GoAgent. Project address :https://github.com/madeye/gaeproxy.git The software name :ProxyDroid Software development ...

  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 install Kali-NetHunter

    1. About Kali NetHunter Kali NetHunter Is a by Offensive Security The team developed and designed , With Nexus( mobile phone / Flat ) For the basic Hardware device , Based on the original Andro ...

Random recommendation

  1. UUID library

    If you cannot afford to use Boost, then there is a very minimal library that I implemented which sim ...

  2. DevExpress In the use of Ribbon The reason why the title bar doesn't change when you skin

    take form Of AllowFormGlass attribute This is False You can skin the title bar .

  3. VIew-CoordinatorLayout note

    CoordinatorLayout The coordinator : It's usually two controls , One Dependency One child ,CoordinatorLayout The main function of is to coordinate the two controls , send child Follow Dependen ...

  4. SVN Server and test server code synchronization

    When doing a local test project , Want to svn Submit and code on the server in one step , Don't want to manually update it again , So we studied the next synchronization , To achieve svn Automatically update to the test server after submission , In your version Library hooks Add under folder post-com ...

  5. Thread local variable ThreadLocal Source code interpretation

      One .ThreadLocal Basic knowledge of The state of the original thread :  According to traditional experience , If an object is not thread safe , In multithreaded environment , Access to objects must use synchronized Thread synchronization . however Spring Various templates in ...

  6. use HttpSessionListener And HttpSessionBindingListener Realize online statistics of the number of people

    The realization of online population statistics , My first thought was , management session, If session When it's destroyed, it's reduced , If you log in, add a new one , But if the user exits illegally , Such as : Not cancelled , Close the browser, etc , This user's session It's management that doesn't work ...

  7. java static

    One . static What does it stand for? stay Java There is no concept of global variables in , But we can pass static To achieve a “ Pseudo Global ” The concept of , stay Java in static Express “ overall situation ” perhaps “ static state ” It means , Used to modify member variables and members ...

  8. In depth analysis :Fragment And Activity There are several ways to interact ( 3、 ... and , Use interface )

    First step : We need to be in Fragment Define an interface , And make sure our containers Activity Implemented this interface : public interface onTestListener { public void onTest ...

  9. java -jar start-up java Project time , Reference different configuration file commands

    java -jar eureka-server.jar --spring.profiles.active=peer1

  10. perventDefault, stopPropagation, stopImmediatePropagation Differences among the three

    event There are three particularly confusing ways , Used to prevent default events from happening 1.  e.preventDefault(); 2. e.stopPropagation(); 3. e.stopImmediatePro ...