Android studio&Gradle&Autotest

20
Fantasy

Transcript of Android studio&Gradle&Autotest

Fantasy

Android Studio is a new Android development environment based on IntelliJ IDEA.

It provides new features and improvements over Eclipse ADT and will be the official Android IDE once it's ready.

Flexible Gradle-based build system.

Build variants and multiple APK generation.

Advanced Android code completion and refactoring.

Expanded template support for Google Services and various device types.

Support rich layout editor, Lint tools,ProGuard.

Project

Packages

Android

One project contain

modules.• JAR

• AAR(Android ARchive)

Similar with Eclipse

New flattened

structure

File group• Manifest

• Source

• Resource

• Gradle

Gradle is build automation evolved.

Gradle combines the power and flexibility of Ant with the dependency management and conventions of Maven into a more effective way to build.

Powered by a Groovy DSL and packed with innovation, Gradle provides a declarative way to describe all kinds of builds through sensible defaults.

Build configuration:• Build variants

• Build type : Debug or Release

• Product falvor: Full or Demo

• Dependencies

• Manifest entries

• Signing

• ProGuard

• Testing

General classification:• Small(unit): preferably milliseconds

• Medium(Integration): preferably few seconds

• Large(System): preferably minutes or hours

Android classification:• Activity Testing

• Service Testing

• Content Provider Testing

• Accessibility Testing

• UI Testing

Monkey• adb shell tool

Monkeyrunner• Uses Jython, a implementation of Python that uses

Java programming language.

UiAutomatorviewer• A GUI tool to scan and analyze the UI components

of an Android application.

UiAutomator• A Java library containing APIs to customized

functional UI tests.

Basic syntax:

Limit in target APP :

Imports the monkeyrunner modules

Connects to the current device

Install the Android package

Run the component

Presses the Back button

Pauses the current program

Simulates a drag gesture

Touches the screen

Takes a screenshot

Use python uiautomator library• Installation

Grammar is similar with Monkeyrunner.• Controls UI component directly !

Testdroid