Suche senden
Hochladen
Android Debugging (Chinese)
•
0 gefällt mir
•
1,200 views
William Lee
Folgen
How to add debugging messages and use GDB in Android.
Weniger lesen
Mehr lesen
Technologie
Unterhaltung & Humor
Melden
Teilen
Melden
Teilen
1 von 8
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
Android Services and Managers Basic
Android Services and Managers Basic
William Lee
GNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in Gnome
William Lee
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) Plugin
William Lee
Android Storage - StorageManager & OBB
Android Storage - StorageManager & OBB
William Lee
Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on Linux
William Lee
CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)
William Lee
Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069
William Lee
Qt Development Tools
Qt Development Tools
William Lee
Empfohlen
Android Services and Managers Basic
Android Services and Managers Basic
William Lee
GNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in Gnome
William Lee
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) Plugin
William Lee
Android Storage - StorageManager & OBB
Android Storage - StorageManager & OBB
William Lee
Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on Linux
William Lee
CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)
William Lee
Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069
William Lee
Qt Development Tools
Qt Development Tools
William Lee
Android Logging System
Android Logging System
William Lee
IPv6 Overview
IPv6 Overview
William Lee
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log Rotation
William Lee
MGCP Overview
MGCP Overview
William Lee
Android Storage - Internal and External Storages
Android Storage - Internal and External Storages
William Lee
Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)
William Lee
MTP & PTP
MTP & PTP
William Lee
Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP Languages
William Lee
Android Storage - Vold
Android Storage - Vold
William Lee
Usage Note of SWIG for PHP
Usage Note of SWIG for PHP
William Lee
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.3
William Lee
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 Walker
William Lee
Usage Note of PlayCap
Usage Note of PlayCap
William Lee
Qt4 App - Sliding Window
Qt4 App - Sliding Window
William Lee
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App Chooser
William Lee
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
William Lee
Note of CGI and ASP
Note of CGI and ASP
William Lee
L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5
William Lee
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 Page
William Lee
Weitere ähnliche Inhalte
Andere mochten auch
Android Logging System
Android Logging System
William Lee
IPv6 Overview
IPv6 Overview
William Lee
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log Rotation
William Lee
MGCP Overview
MGCP Overview
William Lee
Android Storage - Internal and External Storages
Android Storage - Internal and External Storages
William Lee
Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)
William Lee
MTP & PTP
MTP & PTP
William Lee
Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP Languages
William Lee
Android Storage - Vold
Android Storage - Vold
William Lee
Andere mochten auch
(9)
Android Logging System
Android Logging System
IPv6 Overview
IPv6 Overview
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log Rotation
MGCP Overview
MGCP Overview
Android Storage - Internal and External Storages
Android Storage - Internal and External Storages
Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)
MTP & PTP
MTP & PTP
Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP Languages
Android Storage - Vold
Android Storage - Vold
Mehr von William Lee
Usage Note of SWIG for PHP
Usage Note of SWIG for PHP
William Lee
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.3
William Lee
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 Walker
William Lee
Usage Note of PlayCap
Usage Note of PlayCap
William Lee
Qt4 App - Sliding Window
Qt4 App - Sliding Window
William Lee
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App Chooser
William Lee
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
William Lee
Note of CGI and ASP
Note of CGI and ASP
William Lee
L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5
William Lee
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 Page
William Lee
Notes for SQLite3 Usage
Notes for SQLite3 Usage
William Lee
Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)
William Lee
Study of Chromium OS
Study of Chromium OS
William Lee
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-069
William Lee
Qt Animation
Qt Animation
William Lee
Mehr von William Lee
(19)
Usage 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
Usage 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)
Usage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency Walker
Usage Note of PlayCap
Usage Note of PlayCap
Qt4 App - Sliding Window
Qt4 App - Sliding Window
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
Note 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.5
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 Page
Notes for SQLite3 Usage
Notes for SQLite3 Usage
Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)
Study 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)
Introdunction to Network Management Protocols - SNMP & TR-069
Introdunction to Network Management Protocols - SNMP & TR-069
Qt Animation
Qt Animation
Android Debugging (Chinese)
1.
Android Debugging William.L wiliwe@gmail.com 2010-11-19 Version
2.
Add Debugging Messages 2
3.
For Java Codes 在Android的Java程式中加入除錯訊息,可使用android.util.Log 類別中提供的靜態(static)函式來達成 Log.v
(String tag, String msg) for Verbose message. (Highest level) Log.d (String tag, String msg) for Debugging message Log.i (String tag, String msg) for Info message Log.w (String tag, String msg) for Warrning message Log.e (String tag, String msg) for Error message (Lowest level) tag是一個標識,可以是任意字串,通常可用 「ClassName + MethodName」 規則來命名 Version 3
4.
For C++/C Codes 在Android的C/C++程式中加入除錯訊息,可使用cutils
函式庫中 提供的函式來達成 LOGV (String tag, String msg) for Verbose message. (Highest level) LOGD (String tag, String msg) for Debugging message LOGI (String tag, String msg) for Info message LOGW (String tag, String msg) for Warrning message LOGE (String tag, String msg) for Error message (Lowest level) 程式中加標頭檔<cutils/log.h> 在Android.mk中中指定 libcutils 共享函式庫 LOCAL_SHARED_LIBRARIES := libcutils
5.
How to see
debugging messages? 查看除錯訊息,可在console下使用下列指令 logcat -s tagName:I[/V/D/W/E] 查詢特定標識的某一種類訊 息 logcat -s tagName:* 查詢特定標識的所有類型 的訊息 logcat 查詢所有類型的訊息且 不區分標識 也可使用DDMS的 Logcat View 察看除錯訊息 Version 5
6.
Using GDB(1/2) Android 2.2(Froyo)源碼目錄中,prebuild目錄下有現成的GDB程式 (目前使用的
ARM EABI版本為 4.4.0) AndroidSrc/prebuilt/linux-x86/toolchain/arm-eabi4.4.0/bin/arm-eabi-gdb GDB用法 : arm-eabi-gdb ExecutableWithDebugSymbol ExecutableWithDebugSymbol 位在目錄 – out/target/product/BoardModel/symbols/system/bin/ 主要使用步驟 (AndroidSrc使用 絕對路徑 絕對路徑) GDB Server 端 (Android裝置) adb shell 登入遠端Android裝置 裝置後執行指令 #> gdbserver :5039 /data/Executable & 或 #> gdbserver :5039 --attach ExecutablePID & Port number 5039, 可自行替換其它數字, 但不可跟其它網路服務使用的衝突
7.
Using GDB(2/2) 主要使用步驟 GDB Client
端 (自己的電腦) arm-eabi-gdb ExecutableWithDebugSymbol ,進入GDB GDB中設定偵錯用函式庫搜路徑(AndroidSrc 使用 絕對路徑 絕對路徑) set solib-absolute-prefix AndroidSrc/out/target/product/BoardModel/symbols/ set solib-search-path AndroidSrc/out/target/product/BoardModel/symbols/system/lib:An droidSrc/out/target/product/ventana/symbols/system/bin target remote :5039 此port number需跟GDB Server使用的 相同 執行 GDB 指令做偵錯動作 b – 設中斷點(breakpoint) display – 檢視(watch)變數/暫存器內容 c – continue n –單步執行(不進入函式) s –單步執行(進入函式)
8.
Reference Android Official Site
http://developer.android.com/guide/developing/debug-tasks.html NV’s http://developer.download.nvidia.com/tegra/docs/android_gdb_debuggi ng.pdf GDB usage – http://tetralet.luna.com.tw/index.php?op=ViewArticle&article Id=187&blogId=1 http://www.cmlab.csie.ntu.edu.tw/~daniel/linux/gdb.html
Jetzt herunterladen