Android studio&Gradle&Autotest

  • View

  • Download

Embed Size (px)



FantasyAndroid Studio &Gradle & Autotest

Demo multi apk Show moudleShow demo full debug release

Android unit test

1Android 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.

Android Studio

Project and module 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.Android Studio advantage ProjectPackagesAndroidAndroid Studio file scope

Project Package Android

4One project contain modules. JAR AAR(Android ARchive)Android Studio-project scope

Similar with EclipseAndroid Studio-package scope

New flattened structureFile groupManifestSourceResource GradleAndroid Studio-android scope

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.Gradle

Gradle groovy configuration:Build variantsBuild type : Debug or ReleaseProduct falvor: Full or DemoDependenciesManifest entriesSigningProGuardTesting

Building multiple APKsBuild coniguration type:Debug Release

Product flavor FullDemo


Gradle-build type

Gradle-product flavorGeneral classificationSmall(unit): preferably millisecondsMedium(Integration): preferably few secondsLarge(System): preferably minutes or hours Android classification:Activity TestingService TestingContent Provider TestingAccessibility TestingUI Testing

Autotest Testing Fundaments shell tool MonkeyrunnerUses Jython, a implementation of Python that uses Java programming language.UiAutomatorviewerA GUI tool to scan and analyze the UI components of an Android application.UiAutomatorA Java library containing APIs to customized functional UI tests.

Android UI testingBasic syntax:

Limit in target APP :

Monkey the monkeyrunner modules

Connects to the current device

Install the Android package

Run the component

Monkeyrunner the Back button

Pauses the current program

Simulates a drag gesture

Touches the screen

Takes a screenshot



Use python uiautomator libraryInstallation

Grammar is similar with Monkeyrunner.Controls UI component directly !


Uianmator test case Testing