iv104109-the-monkeytool-toolreveiw

13
The Monkey Tool Goofing around with Android

Upload: isaac-van-houten

Post on 26-May-2015

59 views

Category:

Devices & Hardware


0 download

DESCRIPTION

Android Monkey Tool Review

TRANSCRIPT

Page 1: Iv104109-the-monkeytool-toolreveiw

The Monkey ToolGoofing around with Android

Page 2: Iv104109-the-monkeytool-toolreveiw

A UI/Application Exerciser

● The Monkey is a command-line tool that that you can run on any Android emulator instance or on a device.

● It sends a pseudo-random stream of user events into the system, which acts as a stress test on the application software you are developing.

Page 3: Iv104109-the-monkeytool-toolreveiw

History and Availability

● The Monkey is a built-in Android UI testing tool, and can be accessed through use of the adb (android debugging bridge) supplied to android developers for free by Google.

Page 4: Iv104109-the-monkeytool-toolreveiw

Other UI/App Testing Tools

● There aren’t any other popular Android UI automated testing tools -- the Monkey tool is meant to be used as a stress-test, while other tools use specific test cases.

● Although ‘monkeyrunner’ is similar to the monkey tool in some ways, Google states that they are unrelated.

Page 5: Iv104109-the-monkeytool-toolreveiw

Sustainability and Performance

● Since the Monkey is included as part of the Android SDK, it is kept up-to-date by Google and has excellent reliability.

● However, testing on an external device, rather than a virtual one, leads to much faster results and less headache. Running the tool on a virtual device can take a lot of processing power.

Page 6: Iv104109-the-monkeytool-toolreveiw

Benefit / Cost

● The tool is packaged with the Android SDK, so it is free to use. This also means that it is compatible with any existing Android project.

● In order to use the monkey, just navigate to the android-sdk folder in your shell, and run the monkey tool on any connected device. Anyone with the sdk can do this.

Page 7: Iv104109-the-monkeytool-toolreveiw

Running the Tool

● The monkey has no GUI interface

● So it must be run from a shell.

Page 8: Iv104109-the-monkeytool-toolreveiw

Running the Tool

● In order to run the monkey, you must have an android device (virtual or otherwise) connected to adb.

● You can only have one device running at a time.

Page 9: Iv104109-the-monkeytool-toolreveiw

Running the Tool

● After starting up, the monkey begins sending user interface events to the device; this is viewable in real time.

Page 10: Iv104109-the-monkeytool-toolreveiw

Running the Tool

● Since the tool is random (pseudo-random), and you can control the amount of tests, the app can end up in odd situations.

Page 11: Iv104109-the-monkeytool-toolreveiw

Testing On Your Own

● In order to use the monkey tool, navigate to your android-sdk folder, and from there to platform-tools.

● From here, you can run the adb tool. ADB comes with a ‘shell’ option, which allows you to access the android device directly.

Page 12: Iv104109-the-monkeytool-toolreveiw

Testing On Your Own

● However, you can simply execute the tool through the adb shell, without actually going through the device files.

○ The ‘-p’ option allows you to choose a specific package for the tool to browse.

○ The ‘-v’ option is for setting something called ‘verbosity’ every -v added increases level of detail

○ The number (1000) at the end of the command is the number of actions to perform.

Page 13: Iv104109-the-monkeytool-toolreveiw

Thoughts

● The Monkey tool is fairly simple to use, and is a great for apps that have a significant amount of user input involved.

● For many apps, which only receive user input for buttons, or small text boxes, then the uses for this tool are limited.

● But if your app requires constant input (like drawing apps), or simultaneous inputs (like a game), then it could be very beneficial.