SlideShare uma empresa Scribd logo
1 de 29
ANDROID SDK
&
TESTING TOOLS
MAKSIM KOVALEV 2014
MAKSIM KOVALEV
SOFTWARE TEST AUTOMATION ENGINEER
maksim.kovalyov@gmail.com
ANDROID SDK
Install x86 version:
http://developer.android.com/sdk/index.html
Includes:
• Eclipse + ADT plugin
• Android SDK Tools
• Android Platform-tools
• The latest Android platform
• The latest Android system image for the emulator
INSTALL WINDOWS DRIVERS
For Samsung go to http://developer.samsung.com:
http://developer.samsung.com/android/tools-sdks/Samsung-Andorid-USB-Driver-for-Windows
For Kindle check it here:
https://developer.amazon.com/appsandservices/resources/development-tools/ide-tools/tech-
docs/01-setting-up-your-development-environment
SDK Manager  Tools  Manage Add-on Sites  User Defined
Sites  New  insert url http://kindle-
sdk.s3.amazonaws.com/addon.xml  OK  Close
Now in SDK Manager packages go to Extras folder  Check Kindle
Fire USB Driver  press Install
Go to sdkextrasamazonkindle_fire_usb_driver on your PC
Run KindleDrivers.exe
For steps with pictures go to https://developer.amazon.com/post/Tx3RZFBU0KJTSWS/Setting-up-the-ADB-driver-for-Kindle-Fire-Devices.html
SDK MANAGER
SDK Manager is used for separate downloading tools, platforms, and other components into packages.
Launch SDK Manager:
• From Eclipse (with ADT), select Window > Android SDK Manager.
• On Windows, double-click the SDK Manager.exe file at the root of the Android SDK directory.
• On Mac or Linux, open a terminal and navigate to the tools/ directory in the Android SDK, then
execute android sdk.
SDK Tools Required.
SDK Platform-tools Required.
SDK Platform Required (at least one platform)
<sdk>/platform-tools/
./adb (console tool)
<sdk>/tools/
./android (Android SDK Manager)
./android avd (AVD Manager)
./monitor (Android Device Monitor)
ADB DEBUGGING
Adb - middleman between a device and your development system. It provides various device management capabilities, including
moving and syncing files to the emulator, running a UNIX shell on the device or emulator, and providing a general means to
communicate with connected emulators and devices.
Dalvik Debug Monitor Server - DDMS is a graphical program that communicates with your devices through adb. DDMS can
capture screenshots, gather thread and stack information, spoof incoming calls and SMS messages, and other...
Device or Android Virtual Device - An adb device daemon runs on the device or emulator and provides a means for the adb host
daemon to communicate with the device or emulator.
ANDROID DEBUG BRIDGE
Android Debug Bridge (adb) is a command line tool that lets you
communicate with an emulator instance or connected Android-
powered device. It is a client-server program.
You can just send commands through Terminal to it:
./adb devices
./adb install <your_apk>
And DO NOT FORGET to enable usb debugging in the developer
settings (go to settings  developer options  enable USB debugging)
DDMS
Dalvik Debug Monitor Server:
• LogCat - Lets you view system log messages in real time.
• Incoming call and SMS spoofing
• Devices - Shows the list of devices and AVDs that are connected to ADB.
• Emulator Control - Lets you carry out device functions.
• Threads - Shows currently running threads within a VM.
• Heap - Shows heap usage for a VM.
• Allocation Tracker - Shows the memory allocation of objects.
• File Explorer - Lets you explore the device's file system.
Using of standalone version of DDMS is deprecated. (./ddms)
Android Device Monitor should be used instead.
DDMS
AVD MANAGER
Start AVD: ./android avd
Start Emulator: ./emulator -avd <avd_name>
Start Emulator with enabled GA: ./emulator -avd <avd_name> -gpu on
Configuring Graphics Acceleration
Must have: Android SDK Tools Revision 17 or higher, Android SDK Platform API 15 - Revision 3 or higher
- create a new AVD with the Target value of Android 4.0.3 (API Level 15), revision 3 or higher.
- in the Hardware section, click New, select GPU emulation and set the value to Yes.
- Name the AVD instance and select any other configuration options.
Caution: Do not select the Snapshot: Enabled option. Snapshots are not supported for emulators with graphics acceleration enabled.
- Click Create AVD to save the emulator configuration.
Configuring Virtual Machine Acceleration
http://developer.android.com/tools/devices/emulator.html
LOGCAT
The LogCat. Common logging methods include:
• v(String, String) (verbose)
• d(String, String) (debug)
• i(String, String) (information)
• w(String, String) (warning)
• e(String, String) (error)
DDMS - SCREEN CAPTURE
MEMORY LEAKS
Install hprof converter for Eclipse
Use standalone version from http://eclipse.org/mat/downloads.php
Or use as a plugin. Go to Eclipse. Help -> Install New Software…
Paste link http://download.eclipse.org/mat/1.3/update-site/
MEMORY LEAKS
In case of using standalone version you need to
convert Dalvik-hprof to J2SE-hprof manually
In cmd run:
hprof-conv.exe <name of your dalvik hprof> <new name for
destination hprof>
Example: hprof-conv.exe my.app.dump.hprof my.app.converted-
dump.hprof
DDMS - MEMORY LEAKS
DDMS - MEMORY LEAKS
Start application, start watching some video. Then click "dump HPROF file"
DDMS - MEMORY LEAKS
Choose "histogram view"
DDMS - MEMORY LEAKS
Do some more actions, play videos, open images, try to scrub in different
directions, etc. and then make heap-snapshot again. When we are ready go to
the latest histogram and click "Compare to another Heap Dump" in the dialog
choose your previous dump and click OK
DDMS - MEMORY LEAKS
In the new-opened view you can see increase of heap and allocated memory for
each object and for sum
DDMS - MEMORY LEAKS
We can see that there is no huge gain of memory and in logs we see that
memalloc periodically cleans buffer
DDMS - MEMORY LEAKS
Also we can go to System view and check current memory usage of device then
quit app and check again to be sure, that memory is cleared after quit.
DDMS - MEMORY LEAKS
Allocation gain.
DDMS - EMULATOR TESTING
Voice Calls SMS Location
MONKEY
1. Install apk to your device:
$ ./adb install ../path/to/your/app/name-of-apk.apk
2. Now we should know package of application that contains MainActivity:
$ ./aapt dump xmltree ../path/to/your/app/name-of-apk.apk AndroidManifest.xml
It was found at the begining:
A: package="com.company.android.appname"
3. Run Monkey with different parameters:
$ ./adb shell monkey -p com.company.android.appname --throttle 10 -v -v --pct-
touch 60 --pct-motion 0 --pct-syskeys 1 --hprof 5000
Explanations:
--hprof generates profiling-reports in folder data/misc
You can get it with $ ./adb pull /data/misc //Volumes/MacintoshHD2/Temp
--throttle is a timeout between actions [ms]
5000 – is a total amount of events
More Command Options here: http://developer.android.com/tools/help/monkey.html
USEFUL CONSOLE COMMANDS
cd android-sdk-macosx/platform-tools/
./aapt dump xmltree ../Path/to/App/apk-name.apk AndroidManifest.xml
./adb install ../Path/to/App/apk-name.apk
./adb devices
./adb -s emulator-5554 install ../Path/to/App/apk-name.apk
./adb -s 4df70f6842f34007 install ../Path/to/App/apk-name.apk
./adb kill-server and ./adb start-server
Working with device/emulator:
./adb shell am start -a com.company.android.appname/.AppMainActivity -n
com.company.android.appname/.AppMainActivity
./adb shell am force-stop -a com.company.android.appname
./adb shell am kill -a com.company.android.appname
./emulator –avd <emulator_name>
./adb shell getprop ro.build.version.release [this gives device’s Android version]
ANDROID MANIFEST
Get AndroidManifest.xml:
./aapt dump xmltree ../Path/to/App/app-name.apk AndroidManifest.xml
Result:
N: android=http://schemas.android.com/apk/res/android
E: manifest (line=2)
A: android:versionCode(0x0101021b)=(type 0x10)0x2
A: android:versionName(0x0101021c)="0.4.8" (Raw: "0.4.8")
A: package="com.company.android.appname" (Raw: "com.company.android.appname")
E: uses-sdk (line=4)
A: android:minSdkVersion(0x0101020c)=(type 0x10)0xe
A: android:targetSdkVersion(0x01010270)=(type 0x10)0xe
Where data is in Hex format.
Min Sdk Version is “android:minSdkVersion(0x0101020c)=(type 0x10)0xe”  “0xe” 
 “e”  14 in decimal. 14 is API level. And appropriate Android version is 4.0
according to http://developer.android.com/about/versions/android-4.0.html
ACTIVITIES LIFECYCLE
BACK – destroys activity
HOME – sends activity to background
CAN BE HELPFUL
Set path to your tools into Environment Variables
System properties -> Advanced -> Environment Variables -> System Variables:
Simply add “;C:pathtosdktools;” into variable Path.
Now you can use tools anywhere from cmd =)
Q&A
Thank you for your
coming! :)

Mais conteúdo relacionado

Destaque

MDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation TestMDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation TestMasud Parvez
 
Athena, Android UI Testing Platfrom
Athena, Android UI Testing PlatfromAthena, Android UI Testing Platfrom
Athena, Android UI Testing PlatfromBuddy Arifin
 
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn ToànTech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn ToànNexus FrontierTech
 
Android Test Automation – one year later
Android Test Automation – one year laterAndroid Test Automation – one year later
Android Test Automation – one year laterDominik Dary
 
Screenshots Test spoon + espresso
Screenshots Test spoon + espressoScreenshots Test spoon + espresso
Screenshots Test spoon + espressoShinobu Okano
 
Test Automation using Athena by OLX - Intro
Test Automation using Athena by OLX - IntroTest Automation using Athena by OLX - Intro
Test Automation using Athena by OLX - IntroMC Gagan
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)David Ehringer
 
Home automation using android mobiles
Home automation using android mobilesHome automation using android mobiles
Home automation using android mobilesDurairaja
 

Destaque (10)

MDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation TestMDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation Test
 
Athena, Android UI Testing Platfrom
Athena, Android UI Testing PlatfromAthena, Android UI Testing Platfrom
Athena, Android UI Testing Platfrom
 
Android development
Android developmentAndroid development
Android development
 
Athena by OLX
Athena by OLXAthena by OLX
Athena by OLX
 
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn ToànTech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
 
Android Test Automation – one year later
Android Test Automation – one year laterAndroid Test Automation – one year later
Android Test Automation – one year later
 
Screenshots Test spoon + espresso
Screenshots Test spoon + espressoScreenshots Test spoon + espresso
Screenshots Test spoon + espresso
 
Test Automation using Athena by OLX - Intro
Test Automation using Athena by OLX - IntroTest Automation using Athena by OLX - Intro
Test Automation using Athena by OLX - Intro
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
 
Home automation using android mobiles
Home automation using android mobilesHome automation using android mobiles
Home automation using android mobiles
 

Semelhante a Android tools for testers

Manish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsManish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsPositive Hack Days
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011pundiramit
 
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.
 
Droidcon uk2012 androvm
Droidcon uk2012 androvmDroidcon uk2012 androvm
Droidcon uk2012 androvmdfages
 
Android chapter02-setup2-emulator
Android chapter02-setup2-emulatorAndroid chapter02-setup2-emulator
Android chapter02-setup2-emulatorguru472
 
Android chapter02-setup1-sdk
Android chapter02-setup1-sdkAndroid chapter02-setup1-sdk
Android chapter02-setup1-sdkTran Le Hoan
 
3 getting to know the android tools - en-us
3   getting to know the android tools - en-us3   getting to know the android tools - en-us
3 getting to know the android tools - en-usJuarez Junior
 
Android chapter02-setup2-emulator
Android chapter02-setup2-emulatorAndroid chapter02-setup2-emulator
Android chapter02-setup2-emulatorTran Le Hoan
 
Mobile development in 2020
Mobile development in 2020 Mobile development in 2020
Mobile development in 2020 Bogusz Jelinski
 
Android Development Tools Overview
Android Development Tools OverviewAndroid Development Tools Overview
Android Development Tools OverviewMike Wolfson
 
Installing iOS and Android Simulators on MacOSX
Installing iOS and Android Simulators on MacOSXInstalling iOS and Android Simulators on MacOSX
Installing iOS and Android Simulators on MacOSXKen Skistimas
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspectiveGunjan Kumar
 
Android developmenttools 20100424
Android developmenttools 20100424Android developmenttools 20100424
Android developmenttools 20100424Marakana Inc.
 

Semelhante a Android tools for testers (20)

Manish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsManish Chasta - Securing Android Applications
Manish Chasta - Securing Android Applications
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
Discover System Facilities inside Your Android Phone
Discover System Facilities inside Your Android Phone Discover System Facilities inside Your Android Phone
Discover System Facilities inside Your Android Phone
 
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
 
Appium- part 1
Appium- part 1Appium- part 1
Appium- part 1
 
Droidcon uk2012 androvm
Droidcon uk2012 androvmDroidcon uk2012 androvm
Droidcon uk2012 androvm
 
Android chapter02-setup2-emulator
Android chapter02-setup2-emulatorAndroid chapter02-setup2-emulator
Android chapter02-setup2-emulator
 
Android chapter02-setup1-sdk
Android chapter02-setup1-sdkAndroid chapter02-setup1-sdk
Android chapter02-setup1-sdk
 
3 getting to know the android tools - en-us
3   getting to know the android tools - en-us3   getting to know the android tools - en-us
3 getting to know the android tools - en-us
 
Android chapter02-setup2-emulator
Android chapter02-setup2-emulatorAndroid chapter02-setup2-emulator
Android chapter02-setup2-emulator
 
Mobile development in 2020
Mobile development in 2020 Mobile development in 2020
Mobile development in 2020
 
Android Development Tools Overview
Android Development Tools OverviewAndroid Development Tools Overview
Android Development Tools Overview
 
Installing iOS and Android Simulators on MacOSX
Installing iOS and Android Simulators on MacOSXInstalling iOS and Android Simulators on MacOSX
Installing iOS and Android Simulators on MacOSX
 
Android debug bridge android developers
Android debug bridge  android developersAndroid debug bridge  android developers
Android debug bridge android developers
 
Android debug bridge android developers
Android debug bridge  android developersAndroid debug bridge  android developers
Android debug bridge android developers
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Android in ubuntu
Android in ubuntuAndroid in ubuntu
Android in ubuntu
 
Android developmenttools 20100424
Android developmenttools 20100424Android developmenttools 20100424
Android developmenttools 20100424
 
Best free tools for w d a
Best free tools for w d aBest free tools for w d a
Best free tools for w d a
 
Best free tools for win database admin
Best free tools for win database adminBest free tools for win database admin
Best free tools for win database admin
 

Último

Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...nishasame66
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfCWS Technology
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsChandrakantDivate1
 
Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesChandrakantDivate1
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsChandrakantDivate1
 

Último (6)

Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and Layouts
 
Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & Examples
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s Tools
 

Android tools for testers

  • 2. MAKSIM KOVALEV SOFTWARE TEST AUTOMATION ENGINEER maksim.kovalyov@gmail.com
  • 3. ANDROID SDK Install x86 version: http://developer.android.com/sdk/index.html Includes: • Eclipse + ADT plugin • Android SDK Tools • Android Platform-tools • The latest Android platform • The latest Android system image for the emulator
  • 4. INSTALL WINDOWS DRIVERS For Samsung go to http://developer.samsung.com: http://developer.samsung.com/android/tools-sdks/Samsung-Andorid-USB-Driver-for-Windows For Kindle check it here: https://developer.amazon.com/appsandservices/resources/development-tools/ide-tools/tech- docs/01-setting-up-your-development-environment SDK Manager  Tools  Manage Add-on Sites  User Defined Sites  New  insert url http://kindle- sdk.s3.amazonaws.com/addon.xml  OK  Close Now in SDK Manager packages go to Extras folder  Check Kindle Fire USB Driver  press Install Go to sdkextrasamazonkindle_fire_usb_driver on your PC Run KindleDrivers.exe For steps with pictures go to https://developer.amazon.com/post/Tx3RZFBU0KJTSWS/Setting-up-the-ADB-driver-for-Kindle-Fire-Devices.html
  • 5. SDK MANAGER SDK Manager is used for separate downloading tools, platforms, and other components into packages. Launch SDK Manager: • From Eclipse (with ADT), select Window > Android SDK Manager. • On Windows, double-click the SDK Manager.exe file at the root of the Android SDK directory. • On Mac or Linux, open a terminal and navigate to the tools/ directory in the Android SDK, then execute android sdk. SDK Tools Required. SDK Platform-tools Required. SDK Platform Required (at least one platform) <sdk>/platform-tools/ ./adb (console tool) <sdk>/tools/ ./android (Android SDK Manager) ./android avd (AVD Manager) ./monitor (Android Device Monitor)
  • 6. ADB DEBUGGING Adb - middleman between a device and your development system. It provides various device management capabilities, including moving and syncing files to the emulator, running a UNIX shell on the device or emulator, and providing a general means to communicate with connected emulators and devices. Dalvik Debug Monitor Server - DDMS is a graphical program that communicates with your devices through adb. DDMS can capture screenshots, gather thread and stack information, spoof incoming calls and SMS messages, and other... Device or Android Virtual Device - An adb device daemon runs on the device or emulator and provides a means for the adb host daemon to communicate with the device or emulator.
  • 7. ANDROID DEBUG BRIDGE Android Debug Bridge (adb) is a command line tool that lets you communicate with an emulator instance or connected Android- powered device. It is a client-server program. You can just send commands through Terminal to it: ./adb devices ./adb install <your_apk> And DO NOT FORGET to enable usb debugging in the developer settings (go to settings  developer options  enable USB debugging)
  • 8. DDMS Dalvik Debug Monitor Server: • LogCat - Lets you view system log messages in real time. • Incoming call and SMS spoofing • Devices - Shows the list of devices and AVDs that are connected to ADB. • Emulator Control - Lets you carry out device functions. • Threads - Shows currently running threads within a VM. • Heap - Shows heap usage for a VM. • Allocation Tracker - Shows the memory allocation of objects. • File Explorer - Lets you explore the device's file system. Using of standalone version of DDMS is deprecated. (./ddms) Android Device Monitor should be used instead.
  • 10. AVD MANAGER Start AVD: ./android avd Start Emulator: ./emulator -avd <avd_name> Start Emulator with enabled GA: ./emulator -avd <avd_name> -gpu on Configuring Graphics Acceleration Must have: Android SDK Tools Revision 17 or higher, Android SDK Platform API 15 - Revision 3 or higher - create a new AVD with the Target value of Android 4.0.3 (API Level 15), revision 3 or higher. - in the Hardware section, click New, select GPU emulation and set the value to Yes. - Name the AVD instance and select any other configuration options. Caution: Do not select the Snapshot: Enabled option. Snapshots are not supported for emulators with graphics acceleration enabled. - Click Create AVD to save the emulator configuration. Configuring Virtual Machine Acceleration http://developer.android.com/tools/devices/emulator.html
  • 11. LOGCAT The LogCat. Common logging methods include: • v(String, String) (verbose) • d(String, String) (debug) • i(String, String) (information) • w(String, String) (warning) • e(String, String) (error)
  • 12. DDMS - SCREEN CAPTURE
  • 13. MEMORY LEAKS Install hprof converter for Eclipse Use standalone version from http://eclipse.org/mat/downloads.php Or use as a plugin. Go to Eclipse. Help -> Install New Software… Paste link http://download.eclipse.org/mat/1.3/update-site/
  • 14. MEMORY LEAKS In case of using standalone version you need to convert Dalvik-hprof to J2SE-hprof manually In cmd run: hprof-conv.exe <name of your dalvik hprof> <new name for destination hprof> Example: hprof-conv.exe my.app.dump.hprof my.app.converted- dump.hprof
  • 15. DDMS - MEMORY LEAKS
  • 16. DDMS - MEMORY LEAKS Start application, start watching some video. Then click "dump HPROF file"
  • 17. DDMS - MEMORY LEAKS Choose "histogram view"
  • 18. DDMS - MEMORY LEAKS Do some more actions, play videos, open images, try to scrub in different directions, etc. and then make heap-snapshot again. When we are ready go to the latest histogram and click "Compare to another Heap Dump" in the dialog choose your previous dump and click OK
  • 19. DDMS - MEMORY LEAKS In the new-opened view you can see increase of heap and allocated memory for each object and for sum
  • 20. DDMS - MEMORY LEAKS We can see that there is no huge gain of memory and in logs we see that memalloc periodically cleans buffer
  • 21. DDMS - MEMORY LEAKS Also we can go to System view and check current memory usage of device then quit app and check again to be sure, that memory is cleared after quit.
  • 22. DDMS - MEMORY LEAKS Allocation gain.
  • 23. DDMS - EMULATOR TESTING Voice Calls SMS Location
  • 24. MONKEY 1. Install apk to your device: $ ./adb install ../path/to/your/app/name-of-apk.apk 2. Now we should know package of application that contains MainActivity: $ ./aapt dump xmltree ../path/to/your/app/name-of-apk.apk AndroidManifest.xml It was found at the begining: A: package="com.company.android.appname" 3. Run Monkey with different parameters: $ ./adb shell monkey -p com.company.android.appname --throttle 10 -v -v --pct- touch 60 --pct-motion 0 --pct-syskeys 1 --hprof 5000 Explanations: --hprof generates profiling-reports in folder data/misc You can get it with $ ./adb pull /data/misc //Volumes/MacintoshHD2/Temp --throttle is a timeout between actions [ms] 5000 – is a total amount of events More Command Options here: http://developer.android.com/tools/help/monkey.html
  • 25. USEFUL CONSOLE COMMANDS cd android-sdk-macosx/platform-tools/ ./aapt dump xmltree ../Path/to/App/apk-name.apk AndroidManifest.xml ./adb install ../Path/to/App/apk-name.apk ./adb devices ./adb -s emulator-5554 install ../Path/to/App/apk-name.apk ./adb -s 4df70f6842f34007 install ../Path/to/App/apk-name.apk ./adb kill-server and ./adb start-server Working with device/emulator: ./adb shell am start -a com.company.android.appname/.AppMainActivity -n com.company.android.appname/.AppMainActivity ./adb shell am force-stop -a com.company.android.appname ./adb shell am kill -a com.company.android.appname ./emulator –avd <emulator_name> ./adb shell getprop ro.build.version.release [this gives device’s Android version]
  • 26. ANDROID MANIFEST Get AndroidManifest.xml: ./aapt dump xmltree ../Path/to/App/app-name.apk AndroidManifest.xml Result: N: android=http://schemas.android.com/apk/res/android E: manifest (line=2) A: android:versionCode(0x0101021b)=(type 0x10)0x2 A: android:versionName(0x0101021c)="0.4.8" (Raw: "0.4.8") A: package="com.company.android.appname" (Raw: "com.company.android.appname") E: uses-sdk (line=4) A: android:minSdkVersion(0x0101020c)=(type 0x10)0xe A: android:targetSdkVersion(0x01010270)=(type 0x10)0xe Where data is in Hex format. Min Sdk Version is “android:minSdkVersion(0x0101020c)=(type 0x10)0xe”  “0xe”   “e”  14 in decimal. 14 is API level. And appropriate Android version is 4.0 according to http://developer.android.com/about/versions/android-4.0.html
  • 27. ACTIVITIES LIFECYCLE BACK – destroys activity HOME – sends activity to background
  • 28. CAN BE HELPFUL Set path to your tools into Environment Variables System properties -> Advanced -> Environment Variables -> System Variables: Simply add “;C:pathtosdktools;” into variable Path. Now you can use tools anywhere from cmd =)
  • 29. Q&A Thank you for your coming! :)