Tuesday, October 30, 2012

Android tools and commands

Android tools and commands

Generates graphical call-stack diagrams from trace log files. The tool uses the Graphviz Dot utility to create the graphical output, so you need to install Graphviz before running dmtracedump. For more information on using dmtracedump, see Profiling with Traceview and dmtracedump.

Draw 9-patch:
Allows you to easily create a NinePatch graphic using a WYSIWYG editor. It also previews stretched versions of the image, and highlights the area in which content is allowed.

Hierarchy Viewer (hierarchyviewer):
Lets you debug and optimize an Android application's user interface.

Lets you quickly analyze your application's layouts in order to optimize them for efficiency.

Helps you create a disk image that you can use with the emulator, to simulate the presence of an external storage card (such as an SD card).

Runs on your emulator or device and generates pseudo-random streams of user events such as clicks, touches, or gestures, as well as a number of system-level events. You can use the Monkey to stress-test applications that you are developing, in a random yet repeatable manner.

Provides an API for writing programs that control an Android device or emulator from outside of Android code.

Shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names.
Lets you access the SQLite data files created and used by Android applications.

Provides a graphical viewer for execution logs saved by your application.

Android Emulator (emulator):
A QEMU-based device-emulation tool that you can use to design, debug, and test your applications in an actual Android run-time environment.

Converts the HPROF file that is generated by the Android SDK tools to a standard format so you can view the file in a profiling tool of your choice.

Desktop app to control an android device remotely using mouse and keyboard. Should work on Windows/Linux/MacOS with any android device.

Sensor Simulator Description:
Sensor simulator is a java standalone application that simulates sensor data and transmits them to the Android emulator.

Video Capture:
This tool allows you to capture what is displayed on your android device as a .avi video movie, useful for recording demonstrations or problem reporting.

re-signer tool:
If you want to test e.g. with Robotium against an existing APK file and you don’t have access to the source code, you need to resign the APK file with your own signature. With the re-signer tool you are now able to resign APK files over a graphical user interface. All you need is the re-sign.jar file and an installed Android SDK.

To check the certificate from an APK file to see, if it is valid or not. Just Drag & Drop the APK file in the window and the tool will show you the SHA1 fingerprint of the APK file.

In general, the process of working with SeeTest includes Connecting the physical mobile device (with USB/WiFi to your computer; note that On-Site Cloud configuration is also available) or the emulator, Recording a script and then Editing it. Once the script is ready, you play it, receive a report and can then export the test code to any testing framework you regularly work with (such as QTP, TestComplete, RFT, C#, JUnit, Python, Perl) and run the tests (as well as edit the test and view a report) from that framework.

Sikuli is a visual technology to automate and test graphical user interfaces (GUI) using images (screenshots).

Listing of adb Commands

The table below lists all of the supported adb commands and explains their meaning and usage.

Direct an adb command to the only attached USB device.
Direct an adb command to the only running emulator instance.
Returns an error if more than one emulator instance is running.
Direct an adb command a specific emulator/device instance, referred to by its adb-assigned serial number (such as "emulator-5556").
If not specified, adb generates an error.
Prints a list of all attached emulator/device instances.
Prints a list of supported adb commands.


logcat [
Prints log data to the screen.


Prints a list of available JDWP processes on a given device.
You can use the forward jdwp: port-forwarding specification to connect to a specific JDWP process. For example:
adb forward tcp:8000 jdwp:472
jdb -attach localhost:8000


Copies a specified file from an emulator/device instance to your development computer.

Copies a specified file from your development computer to an emulator/device instance.

Ports and Networking
Forwards socket connections from a specified local port to a specified remote port on the emulator/device instance.
Port specifications can use these schemes:


ppp  [parm]...
Run PPP over USB.

— the tty for PPP stream. For example dev:/dev/omap_csmi_ttyl.
[parm]... &mdash zero or more PPP/PPPD options, such as defaultroute, local, notty, etc.

Note that you should not automatically start a PDP connection.
Prints the adb instance serial number string.
Prints the adb state of an emulator/device instance.
Blocks execution until the device is online — that is, until the instance state is device.
You can prepend this command to other adb commands, in which case adb will wait until the emulator/device instance is connected before issuing the other commands. Here's an example:

adb wait-for-device shell getprop

Note that this command does not cause adb to wait until the entire system is fully booted. For that reason, you should not prepend it to other commands that require a fully booted system. As an example, the install requires the Android package manager, which is available only after the system is fully booted. A command such as

adb wait-for-device install .apk

Checks whether the adb server process is running and starts it, if not.

Terminates the adb server process.

Starts a remote shell in the target emulator/device instance.
shell []
Issues a shell command in the target emulator/device instance and then exits the remote shell.

Fastboot Commands:

fastboot devices – lists which devices in fastboot mode are currently attached to your computer
fastboot boot – boots a rom stored on your pc specified by the filename
fastboot flash – flashes a rom stored on your pc, partition can be one of {boot, recovery, system, userdata}

No comments: