SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
Anroid Logging System
William.L
wiliwe@gmail.com
Date: 2011-07-21
Outline
Overview of Android Loggin System
Log from Java program
Log from Native C/C++ program
How to read log?
Tips
Overview of Android
Logging System
What is Android Logging System?
Provide a mechanism for collecting and viewing
system debug output
Logs from various applications and portions of
the system are collected in a series of circular
buffers, which then can be viewed and filtered by
the logcat command
Overview of Logging System
[Android Device]
[HOST/PC]
USB
cable
Introduction
The logging system consists of
A kernel driver and kernel buffers for storing log messages
HoneycombMR2Src/kernel/drivers/staging/android/logger.c
Create “/dev/log” folder in handle_device_event() of
AndroidSrc/system/core/init/devices.c
C/C++/Java APIs and classes
For making log messages
For accessing the log messages
logcat, the command for viewing log messages
AndroidSrc/system/core/logcat/
Ability to view and filter the log messages from the host
machine (via Eclipse-ADT or DDMS)
Log device files
4 channels, each have a Ring/Circular Buffer
/dev/log/radio – radio&phone-related messages (64KB)
/dev/log/events – system/hardware events (256KB)
/dev/log/system –framwork or low-level system messages
(64KB)
/dev/log/main – everything else (64KB)
The maximum log message size of each channel is specified in
kernel driver(logger.c)
File permission of each(radio/events/system/main) is
0662 (rw-rw-w)
owner/group RW,
other Write only
owner=root, group=log
Anyone can Write logs, root or log group can Read them
Android Debug Bridge
ADB client
Runs on your development machine(Host).
You can invoke a client from a shell by issuing an “adb”
command.
Other Android tools such as the ADT plugin and DDMS also
create adb clients.
ADB server (adbserver)
Runs on your development machine(Host).
The server manages communication between the client and the
adb daemon running on an emulator or device.
ADB daemon (adbd)
Runs on each Android emulator or Android device instance.
Log from Java program
Classes used for Logging
android.util.Log class
System.out / System.err
android.util.Log
Static methods
AndroidSrc/frameworks/base/core/java/android/util/Log.
java
Error messageLog.e (String tag, String msg)
Warrning messageLog.w (String tag, String msg)
Info messageLog.i (String tag, String msg)
Debugging messageLog.d (String tag, String msg)
Verbose messageLog.v (String tag, String msg)
Example :
/* In Java code, add the following codes */
import android.util.Log;
class CCLLAASS {
static String TAG=“tagName”;
public MethodXX() {
Log.v(TAG, “Debugging messages you want”);
}
}
System.out / System.err (1/2)
System.out/System.err output to Android log
zygoteInit() {
System.setOut(AndroidPrintStream);
System.setErr(AndroidPrintStream); }
AndroidSrc/frameworks/base/core/java/com/android/internal/o
s/RuntimeInit.java
com.android.internal.os.AndroidPrintStream (which derives
from LoggingPrintStream which derives from
PrintStream)
AndroidSrc/frameworks/base/core/java/com/android/internal/o
s/AndroidPrintStream.java
System.out / System.err (2/2)
How to identify instance of System.out/System.err?
System.out.println(”System.out=”+System.out.toString())
System.err.println(”System.err=”+System.err.toString())
Example :
/* Add the System.out and System.err statements in the constructor of MountService.java */
class MountService {
MountService() {
….
System.out.println(”System.out’s instance is ”+System.out.toString());
System.err.println(”System.err’s instance is ”+System.err.toString());
….
}
}
Log from Native C/C++
program
Library for Logging
Use liblog library
Include <android/log.h> header
<cutils/log.h>(libcutils) header could be used
This header includes <android/log.h> eventually
__android_log_print macro(defined in liblog) is the
actual worker behind LOGI[V/D/W/E] functions
Example :
#define LOGI(...) 
__android_log_print (ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
Usage :
LOGI(”i=%d, name=%sn”, i, name);
Log From Native Program (1/2)
Log functions
Error messageLOGE (String msg)
Warrning messageLOGW (String msg)
Info messageLOGI (String msg)
Debugging messageLOGD (String msg)
Verbose message.LOGV (String msg)
Example :
/* In C/C++ code, add the following codes*/
#define LOG_TAG “tagName”
#include <cutils/log.h>
LOGV(“Debugging messages you want”);
Log From Native Program (2/2)
It must add following definition BEFORE the header
"#include <cutils/log.h>"
#undef NDEBUG : Enable LOGV/LOGI/LOGD
#define LOG_NDEBUG 0 : Enable LOGV
#define LOG_NIDEBUG 0 : Enable LOGI
#define LOG_NDDEBUG 0 : Enable LOGD
#define LOG_TAG “String-You-Want"
Because all the above are defined in <cutils/log.h>,
if the define is put after the header including
statment, it will show “redefined” compile warning
and define will not take effect
How to read log?
Logcat Command
“logcat” command runs on Android device
Use the command to run ‘logcat’ command on
the remote Android device : “adb shell logcat”
ADB Logcat
Command : adb logcat
Logcat pane in ADT, Eclipse
Tips
Dumping stack trace
logwrapper
Log at ‘init’ process
Support Non built-in ADB USB VID
Dumping stack trace (1/2)
3 arguments methods in android.util.Log class
Ex: Log.e(String tag, String msg, new Throwable())
Throwable.printStacktrace() also works
Dump to System.err
Dumping stack trace (2/2)
Example for Throwable.printStackTrace (MountService.java) :
class MountService extends IMountService.Stub implements INativeDaemonConnectorCallbacks
{
public static void NewException() throws Throwable
{
throw new Throwable("New Exception...");
}
public MountSerivce(Context context) {
…
try {
NewException();
} catch (Throwable e) {
// Prints this throwable and its backtrace to the
// standard error stream.
e.printStackTrace();
}
...
}
…
}
logwrapper
Redirects stdout(like printf)/stderr to Android
Logging system
Usage
“logwrapper Executable”, and use “logcat” to watch logs as
usual
Ex : “logwrapper ObbFile_test”
Executing without ‘logwrapper’ Executing with ‘logwrapper’
Log at init process
The first process, 'init‘, does not use Android
Logging System.
‘init’ writes log to (the same node as) '/dev/kmsg'
The same way as 'printk()'
Add a command in init.rc to write Android logs to
kernel logging file, /dev/kmsg
Command :
Watch logs : run “adb shell dmesg” on the host
Shortpoint : duplicated store of Android log
To save output messages of logcat
logcat -f fileName
service logcat /system/bin/logcat -f /dev/kmsg
oneshot
Support Non built-in ADB USB VID (1/2)
ADB built-in USB VID
http://developer.android.com/guide/developing/device.html
#VendorIds
Solution-1 : Append the new USB VID into the
adb_usb.ini file
Commands (executing on the host, e.g.PC/NB) :
Create the folder/file ‘~/.android/adb_usb.ini’ if it does not
exist
‘adb’ command reads and checks content of this file each time it
is executed
echo "New-Vendor-ID" >> ~/.android/adb_usb.ini
sudo -s "adb kill-server;adb start-server“
Example (Lenovo VID : 0x17EF) :
/* It can watch the VID of an Android device
using ‘lsusb’ command under the host */
#> echo "0x17EF" >> ~/.android/adb_usb.ini
#> sudo -s "adb kill-server;adb start-server"
Support Non built-in ADB USB VID (2/2)
Solution-2 : Build a new ‘adb’ tool supporting new
VID
In AndroidSrc/system/core/adb/usb_vendors.c
#define VENDOR-NAME Vendor-ID
Add an entry with new VENDOR-NAME in variable
builtInVendorIds[] and then compile ‘adb’ sources
Built new ‘adb’ exectuable is under the folder :
out/host/linux-x86/bin/
Ex - In AndroidSrc/system/core/adb/usb_vendors.c :
// Lenovo's USB Vendor ID
#define VENDOR_ID_LENOVO 0x17EF
/** built-in vendor list */
int builtInVendorIds[] = {
....... ,
VENDOR_ID_LENOVO
};
Reference
http://elinux.org/Android_Logging_System
Android Logging system slide -
http://blog.kmckk.com/archives/2936958.html
logwrapper -
http://blog.kmckk.com/archives/2918551.html
Print Call Stack -
http://blog.kmckk.com/archives/2902690.html

Más contenido relacionado

La actualidad más candente

Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debuggingUtkarsh Mankad
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting SequenceJayanta Ghoshal
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesChris Simmonds
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Opersys inc.
 
android architecture
android architectureandroid architecture
android architectureAashita Gupta
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewYu-Hsin Hung
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverNanik Tolaram
 
ADB(Android Debug Bridge): How it works?
ADB(Android Debug Bridge): How it works?ADB(Android Debug Bridge): How it works?
ADB(Android Debug Bridge): How it works?Tetsuyuki Kobayashi
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidzeelpatel0504
 

La actualidad más candente (20)

Android Architecture
Android ArchitectureAndroid Architecture
Android Architecture
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Introduction to Android Window System
Introduction to Android Window SystemIntroduction to Android Window System
Introduction to Android Window System
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting Sequence
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot images
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 
android architecture
android architectureandroid architecture
android architecture
 
Low Level View of Android System Architecture
Low Level View of Android System ArchitectureLow Level View of Android System Architecture
Low Level View of Android System Architecture
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture Overview
 
Android Booting Scenarios
Android Booting ScenariosAndroid Booting Scenarios
Android Booting Scenarios
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
ADB(Android Debug Bridge): How it works?
ADB(Android Debug Bridge): How it works?ADB(Android Debug Bridge): How it works?
ADB(Android Debug Bridge): How it works?
 
SQLite database in android
SQLite database in androidSQLite database in android
SQLite database in android
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 

Destacado

Effortless network response logging on Android
Effortless network response logging on AndroidEffortless network response logging on Android
Effortless network response logging on AndroidSimon Percic
 
GNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in GnomeGNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in GnomeWilliam Lee
 
Android Debugging (Chinese)
Android Debugging (Chinese)Android Debugging (Chinese)
Android Debugging (Chinese)William Lee
 
Android Services and Managers Basic
Android Services and Managers BasicAndroid Services and Managers Basic
Android Services and Managers BasicWilliam Lee
 
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginMoblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginWilliam Lee
 
Android Storage - StorageManager & OBB
Android Storage - StorageManager & OBBAndroid Storage - StorageManager & OBB
Android Storage - StorageManager & OBBWilliam Lee
 
Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxUsage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxWilliam Lee
 
Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069William Lee
 
CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)William Lee
 
Qt Development Tools
Qt Development ToolsQt Development Tools
Qt Development ToolsWilliam Lee
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationWilliam Lee
 
Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)Ted Liang
 
Android Storage - Internal and External Storages
Android Storage - Internal and External StoragesAndroid Storage - Internal and External Storages
Android Storage - Internal and External StoragesWilliam Lee
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle瑋琮 林
 

Destacado (20)

Android - ADB
Android - ADBAndroid - ADB
Android - ADB
 
Effortless network response logging on Android
Effortless network response logging on AndroidEffortless network response logging on Android
Effortless network response logging on Android
 
GNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in GnomeGNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in Gnome
 
Android Debugging (Chinese)
Android Debugging (Chinese)Android Debugging (Chinese)
Android Debugging (Chinese)
 
Android Services and Managers Basic
Android Services and Managers BasicAndroid Services and Managers Basic
Android Services and Managers Basic
 
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginMoblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) Plugin
 
Android Storage - StorageManager & OBB
Android Storage - StorageManager & OBBAndroid Storage - StorageManager & OBB
Android Storage - StorageManager & OBB
 
Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxUsage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on Linux
 
Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069
 
CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)
 
Qt Development Tools
Qt Development ToolsQt Development Tools
Qt Development Tools
 
Android internals
Android internalsAndroid internals
Android internals
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log Rotation
 
IPv6 Overview
IPv6 OverviewIPv6 Overview
IPv6 Overview
 
Google android Activity lifecycle
Google android Activity lifecycle Google android Activity lifecycle
Google android Activity lifecycle
 
The android activity lifecycle
The android activity lifecycleThe android activity lifecycle
The android activity lifecycle
 
MGCP Overview
MGCP OverviewMGCP Overview
MGCP Overview
 
Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)
 
Android Storage - Internal and External Storages
Android Storage - Internal and External StoragesAndroid Storage - Internal and External Storages
Android Storage - Internal and External Storages
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle
 

Similar a Android Logging System

.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and TechniquesBala Subra
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging TechniquesBala Subra
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011pundiramit
 
Android developmenttools 20100424
Android developmenttools 20100424Android developmenttools 20100424
Android developmenttools 20100424Marakana Inc.
 
Android tools for testers
Android tools for testersAndroid tools for testers
Android tools for testersMaksim Kovalev
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developermpaproductions
 
lecture-2-android-dev.pdf
lecture-2-android-dev.pdflecture-2-android-dev.pdf
lecture-2-android-dev.pdfjakjak36
 
Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Massimo Oliviero
 
Android OS Porting: Introduction
Android OS Porting: IntroductionAndroid OS Porting: Introduction
Android OS Porting: IntroductionJollen Chen
 
Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014Paris Android User Group
 
Eric Lafortune - Fighting application size with ProGuard and beyond
Eric Lafortune - Fighting application size with ProGuard and beyondEric Lafortune - Fighting application size with ProGuard and beyond
Eric Lafortune - Fighting application size with ProGuard and beyondGuardSquare
 
Eric Lafortune - Fighting application size with ProGuard and beyond
Eric Lafortune - Fighting application size with ProGuard and beyondEric Lafortune - Fighting application size with ProGuard and beyond
Eric Lafortune - Fighting application size with ProGuard and beyondGuardSquare
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdbRoman Podoliaka
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Androidnatdefreitas
 

Similar a Android Logging System (20)

Logging system of Android
Logging system of AndroidLogging system of Android
Logging system of Android
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
Android developmenttools 20100424
Android developmenttools 20100424Android developmenttools 20100424
Android developmenttools 20100424
 
Android basics
Android basicsAndroid basics
Android basics
 
Android tools for testers
Android tools for testersAndroid tools for testers
Android tools for testers
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developer
 
lecture-2-android-dev.pdf
lecture-2-android-dev.pdflecture-2-android-dev.pdf
lecture-2-android-dev.pdf
 
Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)
 
Android OS Porting: Introduction
Android OS Porting: IntroductionAndroid OS Porting: Introduction
Android OS Porting: Introduction
 
Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014
 
Eric Lafortune - Fighting application size with ProGuard and beyond
Eric Lafortune - Fighting application size with ProGuard and beyondEric Lafortune - Fighting application size with ProGuard and beyond
Eric Lafortune - Fighting application size with ProGuard and beyond
 
Eric Lafortune - Fighting application size with ProGuard and beyond
Eric Lafortune - Fighting application size with ProGuard and beyondEric Lafortune - Fighting application size with ProGuard and beyond
Eric Lafortune - Fighting application size with ProGuard and beyond
 
Android dev
Android devAndroid dev
Android dev
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
 
Android Attacks
Android AttacksAndroid Attacks
Android Attacks
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
Book
BookBook
Book
 

Más de William Lee

Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesUsage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesWilliam Lee
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHPWilliam Lee
 
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 William Lee
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3William Lee
 
Viewing Android Source Files in Eclipse (Chinese)
Viewing Android Source Files in Eclipse  (Chinese)Viewing Android Source Files in Eclipse  (Chinese)
Viewing Android Source Files in Eclipse (Chinese)William Lee
 
Usage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerUsage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerWilliam Lee
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCapWilliam Lee
 
Qt4 App - Sliding Window
Qt4 App - Sliding WindowQt4 App - Sliding Window
Qt4 App - Sliding WindowWilliam Lee
 
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserGTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserWilliam Lee
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserWilliam Lee
 
Note of CGI and ASP
Note of CGI and ASPNote of CGI and ASP
Note of CGI and ASPWilliam Lee
 
L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5William Lee
 
C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)William Lee
 
Internationalization(i18n) of Web Page
Internationalization(i18n) of Web PageInternationalization(i18n) of Web Page
Internationalization(i18n) of Web PageWilliam Lee
 
Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 UsageWilliam Lee
 
Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)William Lee
 
Study of Chromium OS
Study of Chromium OSStudy of Chromium OS
Study of Chromium OSWilliam Lee
 
More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)William Lee
 
Introdunction to Network Management Protocols - SNMP & TR-069
Introdunction to Network Management Protocols - SNMP & TR-069Introdunction to Network Management Protocols - SNMP & TR-069
Introdunction to Network Management Protocols - SNMP & TR-069William Lee
 

Más de William Lee (20)

Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesUsage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP Languages
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHP
 
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3
 
Viewing Android Source Files in Eclipse (Chinese)
Viewing Android Source Files in Eclipse  (Chinese)Viewing Android Source Files in Eclipse  (Chinese)
Viewing Android Source Files in Eclipse (Chinese)
 
Usage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerUsage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency Walker
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCap
 
Qt4 App - Sliding Window
Qt4 App - Sliding WindowQt4 App - Sliding Window
Qt4 App - Sliding Window
 
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserGTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App Chooser
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
 
Note of CGI and ASP
Note of CGI and ASPNote of CGI and ASP
Note of CGI and ASP
 
L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5
 
C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)
 
Internationalization(i18n) of Web Page
Internationalization(i18n) of Web PageInternationalization(i18n) of Web Page
Internationalization(i18n) of Web Page
 
Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 Usage
 
Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)
 
Study of Chromium OS
Study of Chromium OSStudy of Chromium OS
Study of Chromium OS
 
More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)
 
Introdunction to Network Management Protocols - SNMP & TR-069
Introdunction to Network Management Protocols - SNMP & TR-069Introdunction to Network Management Protocols - SNMP & TR-069
Introdunction to Network Management Protocols - SNMP & TR-069
 
Qt Animation
Qt AnimationQt Animation
Qt Animation
 

Último

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Último (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Android Logging System

  • 2. Outline Overview of Android Loggin System Log from Java program Log from Native C/C++ program How to read log? Tips
  • 4. What is Android Logging System? Provide a mechanism for collecting and viewing system debug output Logs from various applications and portions of the system are collected in a series of circular buffers, which then can be viewed and filtered by the logcat command
  • 5. Overview of Logging System [Android Device] [HOST/PC] USB cable
  • 6. Introduction The logging system consists of A kernel driver and kernel buffers for storing log messages HoneycombMR2Src/kernel/drivers/staging/android/logger.c Create “/dev/log” folder in handle_device_event() of AndroidSrc/system/core/init/devices.c C/C++/Java APIs and classes For making log messages For accessing the log messages logcat, the command for viewing log messages AndroidSrc/system/core/logcat/ Ability to view and filter the log messages from the host machine (via Eclipse-ADT or DDMS)
  • 7. Log device files 4 channels, each have a Ring/Circular Buffer /dev/log/radio – radio&phone-related messages (64KB) /dev/log/events – system/hardware events (256KB) /dev/log/system –framwork or low-level system messages (64KB) /dev/log/main – everything else (64KB) The maximum log message size of each channel is specified in kernel driver(logger.c) File permission of each(radio/events/system/main) is 0662 (rw-rw-w) owner/group RW, other Write only owner=root, group=log Anyone can Write logs, root or log group can Read them
  • 8. Android Debug Bridge ADB client Runs on your development machine(Host). You can invoke a client from a shell by issuing an “adb” command. Other Android tools such as the ADT plugin and DDMS also create adb clients. ADB server (adbserver) Runs on your development machine(Host). The server manages communication between the client and the adb daemon running on an emulator or device. ADB daemon (adbd) Runs on each Android emulator or Android device instance.
  • 9. Log from Java program
  • 10. Classes used for Logging android.util.Log class System.out / System.err
  • 11. android.util.Log Static methods AndroidSrc/frameworks/base/core/java/android/util/Log. java Error messageLog.e (String tag, String msg) Warrning messageLog.w (String tag, String msg) Info messageLog.i (String tag, String msg) Debugging messageLog.d (String tag, String msg) Verbose messageLog.v (String tag, String msg) Example : /* In Java code, add the following codes */ import android.util.Log; class CCLLAASS { static String TAG=“tagName”; public MethodXX() { Log.v(TAG, “Debugging messages you want”); } }
  • 12. System.out / System.err (1/2) System.out/System.err output to Android log zygoteInit() { System.setOut(AndroidPrintStream); System.setErr(AndroidPrintStream); } AndroidSrc/frameworks/base/core/java/com/android/internal/o s/RuntimeInit.java com.android.internal.os.AndroidPrintStream (which derives from LoggingPrintStream which derives from PrintStream) AndroidSrc/frameworks/base/core/java/com/android/internal/o s/AndroidPrintStream.java
  • 13. System.out / System.err (2/2) How to identify instance of System.out/System.err? System.out.println(”System.out=”+System.out.toString()) System.err.println(”System.err=”+System.err.toString()) Example : /* Add the System.out and System.err statements in the constructor of MountService.java */ class MountService { MountService() { …. System.out.println(”System.out’s instance is ”+System.out.toString()); System.err.println(”System.err’s instance is ”+System.err.toString()); …. } }
  • 14. Log from Native C/C++ program
  • 15. Library for Logging Use liblog library Include <android/log.h> header <cutils/log.h>(libcutils) header could be used This header includes <android/log.h> eventually __android_log_print macro(defined in liblog) is the actual worker behind LOGI[V/D/W/E] functions Example : #define LOGI(...) __android_log_print (ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) Usage : LOGI(”i=%d, name=%sn”, i, name);
  • 16. Log From Native Program (1/2) Log functions Error messageLOGE (String msg) Warrning messageLOGW (String msg) Info messageLOGI (String msg) Debugging messageLOGD (String msg) Verbose message.LOGV (String msg) Example : /* In C/C++ code, add the following codes*/ #define LOG_TAG “tagName” #include <cutils/log.h> LOGV(“Debugging messages you want”);
  • 17. Log From Native Program (2/2) It must add following definition BEFORE the header "#include <cutils/log.h>" #undef NDEBUG : Enable LOGV/LOGI/LOGD #define LOG_NDEBUG 0 : Enable LOGV #define LOG_NIDEBUG 0 : Enable LOGI #define LOG_NDDEBUG 0 : Enable LOGD #define LOG_TAG “String-You-Want" Because all the above are defined in <cutils/log.h>, if the define is put after the header including statment, it will show “redefined” compile warning and define will not take effect
  • 18. How to read log?
  • 19. Logcat Command “logcat” command runs on Android device Use the command to run ‘logcat’ command on the remote Android device : “adb shell logcat”
  • 20. ADB Logcat Command : adb logcat
  • 21. Logcat pane in ADT, Eclipse
  • 22. Tips Dumping stack trace logwrapper Log at ‘init’ process Support Non built-in ADB USB VID
  • 23. Dumping stack trace (1/2) 3 arguments methods in android.util.Log class Ex: Log.e(String tag, String msg, new Throwable()) Throwable.printStacktrace() also works Dump to System.err
  • 24. Dumping stack trace (2/2) Example for Throwable.printStackTrace (MountService.java) : class MountService extends IMountService.Stub implements INativeDaemonConnectorCallbacks { public static void NewException() throws Throwable { throw new Throwable("New Exception..."); } public MountSerivce(Context context) { … try { NewException(); } catch (Throwable e) { // Prints this throwable and its backtrace to the // standard error stream. e.printStackTrace(); } ... } … }
  • 25. logwrapper Redirects stdout(like printf)/stderr to Android Logging system Usage “logwrapper Executable”, and use “logcat” to watch logs as usual Ex : “logwrapper ObbFile_test” Executing without ‘logwrapper’ Executing with ‘logwrapper’
  • 26. Log at init process The first process, 'init‘, does not use Android Logging System. ‘init’ writes log to (the same node as) '/dev/kmsg' The same way as 'printk()' Add a command in init.rc to write Android logs to kernel logging file, /dev/kmsg Command : Watch logs : run “adb shell dmesg” on the host Shortpoint : duplicated store of Android log To save output messages of logcat logcat -f fileName service logcat /system/bin/logcat -f /dev/kmsg oneshot
  • 27. Support Non built-in ADB USB VID (1/2) ADB built-in USB VID http://developer.android.com/guide/developing/device.html #VendorIds Solution-1 : Append the new USB VID into the adb_usb.ini file Commands (executing on the host, e.g.PC/NB) : Create the folder/file ‘~/.android/adb_usb.ini’ if it does not exist ‘adb’ command reads and checks content of this file each time it is executed echo "New-Vendor-ID" >> ~/.android/adb_usb.ini sudo -s "adb kill-server;adb start-server“ Example (Lenovo VID : 0x17EF) : /* It can watch the VID of an Android device using ‘lsusb’ command under the host */ #> echo "0x17EF" >> ~/.android/adb_usb.ini #> sudo -s "adb kill-server;adb start-server"
  • 28. Support Non built-in ADB USB VID (2/2) Solution-2 : Build a new ‘adb’ tool supporting new VID In AndroidSrc/system/core/adb/usb_vendors.c #define VENDOR-NAME Vendor-ID Add an entry with new VENDOR-NAME in variable builtInVendorIds[] and then compile ‘adb’ sources Built new ‘adb’ exectuable is under the folder : out/host/linux-x86/bin/ Ex - In AndroidSrc/system/core/adb/usb_vendors.c : // Lenovo's USB Vendor ID #define VENDOR_ID_LENOVO 0x17EF /** built-in vendor list */ int builtInVendorIds[] = { ....... , VENDOR_ID_LENOVO };
  • 29. Reference http://elinux.org/Android_Logging_System Android Logging system slide - http://blog.kmckk.com/archives/2936958.html logwrapper - http://blog.kmckk.com/archives/2918551.html Print Call Stack - http://blog.kmckk.com/archives/2902690.html