android developmenttools 20100424
DESCRIPTION
http://www.sfandroid.org/calendar/13050451/TRANSCRIPT
Android Development ToolsDebugging / Profiling
Joachim Pfeiffer joachim.pfeiffer at gmail dot com
San Francisco Android User’s Group27 April 2010
Presentation Topics
• Resources• Android Debug Bridge (adb)• sqlite3• Dalvik Debug Monitor Service (ddms)• Traceview• Emulator (focus on dev tools)• Discussion
Resources
• Google Android Developer Guidehttp://developer.android.com/guide/developing/tools/index.html
• Google I/O 2009 session videosMattson: http://code.google.com/events/io/2009/sessions/DebuggingArtsNinjaMasters.htmlGuy:http://code.google.com/events/io/2009/sessions/TurboChargeUiAndroidFast.html
Android Developer Bridge (adb)
• Launch from CLI, e.g. Cygwin• Install / uninstall apps $adb install, adb uninstall
• Push / pull files $ adb push, adb pull
• Pull logs $ adb logcat• Attach jdb $ adb jdwp:<process>• Start remote shell $ adb shell
Run shell commands. Use at own risk
sqlite3• Access through adb remote shell• Run SQL commands on SQLite databases• Similar to MySQL or Oracle SQL*Plus• Example:
Dalvik Debug Monitor Service (ddms)
• Screen capture• Thread and heap information• Logcat• System info• Call and location data spoofing• Launch Traceview from ddms
Dalvik Debug Monitor Service (ddms)
Dalvik Debug Monitor Service (ddms)
• Threads of a selected process
Dalvik Debug Monitor Service (ddms)
• Heap of a selected process
Dalvik Debug Monitor Service (ddms)
• Logcat with save-to-file
Dalvik Debug Monitor Service (ddms)
• System info
Dalvik Debug Monitor Service (ddms)
• Call and location data spoofing-> Run simulations for emulator
Traceview
• Launch from ddms
Traceview• Record method invocations over a selected time period. For each method:
- Percentage of time used- Number of calls- Average time / call
• Drill down:- Show parent callers- Show children called- Magnify time scale
Traceview
Traceview
Traceview
• Insert expensive code, in drawStop():
Traceview
Emulator (focus on dev tools)
• Emulator development tools are provided in a separate app, DevTools
• Variety of functions, such as show processes, CPU utilization on screen (you’re probably better off using ddms)
• Most useful component: Show screen updates
The End
Discussion…