20
By Mike Wolfson @mikewolfson Test and Debug with Android Dev Tools Marc

Android Development Tools Overview

Embed Size (px)

DESCRIPTION

This presentation details some of the most commonly used, and important tools used for Android development. This was a class given at AnDevCon.

Citation preview

Page 1: Android Development Tools Overview

By Mike Wolfson@mikewolfson

Test and Debug with Android Dev Tools

San Francisco, CA March 8, 2011

Page 2: Android Development Tools Overview

Session Overview

• Emulator• DDMS• ADB• Hierarchy Viewer• Other important tools

Page 3: Android Development Tools Overview

Why are we here?

Fit and Finish

Page 4: Android Development Tools Overview

• What it is• Capabilities• Limitations• SDK and AVD Manager

Emulator - control

Page 5: Android Development Tools Overview

• What’s an Android Virtual Device?• Creating Custom AVDs–Using Skins

• Speed it up–Disable boot & other animation–Leave it up–Honeycomb – change RAM to 1GB

• Using “Snapshot” to save emulator state

Emulator - AVDs

Page 6: Android Development Tools Overview

• Hacking the emulator–Scale factor (0.1 – 3)–File system access (\.android\avd)–Accessing the Market• http://developer.htc.com/google-io-

device.html#s3

Emulator - AVDs

Page 7: Android Development Tools Overview

Emulator - control

• Key Commands: emulator –help-keys–Switch orientation: • Cntrl-F12; KEYPAD_9; Ctrl+Cmd+F11

–Home: Home; Back: Esc–Call\Dial: F3–Camera: Ctrl-KEYPAD_5–Fullscreen Toggle: Alt-Enter

Page 8: Android Development Tools Overview

• How DDMS Works• Starting DDMS–From Eclipse–From Command Line

• Devices• Tip: File>Preferences

DDMS – Dalvik Debug Monitor Service

Page 9: Android Development Tools Overview

• Logcat–Different Levels–Viewing from DDMS–Controlling from command line

• Tip– final static boolean DEBUG_MODE = false;

if (DEBUG_MODE) Log.i(LOG_TAG,"Load level: " + mLevel);

DDMS – Logs and output

Page 10: Android Development Tools Overview

• V- Verbose• D- Debug• I – Info• W – Warning• E- Error• F- Fatal• S- Silent

DDMS – Logcat settings

Page 11: Android Development Tools Overview

•Memory–View Heap Usage–Tracking memory allocation

• Threads•Garbage Collection

DDMS – Memory and File Explorer

Page 12: Android Development Tools Overview

• Simulate Events–Telephony (Status & Actions)–Location•Capture screen images• File Explorer

DDMS – Simulating Events & Extras

Page 13: Android Development Tools Overview

• What it is• Command control of device–adb devices–adb -s emulator-5556 install

helloWorld.apk–adb install c:\myapp\app.apk

ADB – Android Device Bridge

Page 14: Android Development Tools Overview

• Emulator• Device–Install USB Driver• http://developer.android.com/sdk/oem-

usb.html–On Device: Applications > Development,

then enable USB debugging.

ADB – Debugging

Page 15: Android Development Tools Overview

• Using the app• Run on emulator–Run on device

• Settings

Dev Tools App

Page 16: Android Development Tools Overview

•What it is• How to run• Layout View• Pixel Perfect View• Alternative: layoutopt tool

Hierarchy Viewer

Page 17: Android Development Tools Overview

• Control via scripts• Test\control multiple devices at once• Functional and regression testing• The API• Running it

Monkey Runner

Page 18: Android Development Tools Overview

Other Tools

• Traceview• Proguard• MonkeyRunner• Command Line

Page 19: Android Development Tools Overview

Conclusion

Performance problems are bugs. Find them quickly

and easily – and fix them!

Page 20: Android Development Tools Overview

Confused? Questions?

@mikewolfson