• Stars
    star
    161
  • Rank 225,883 (Top 5 %)
  • Language
    Groovy
  • License
    GNU General Publi...
  • Created over 9 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A plugin that allows you to control, simply, all your Genymotion devices from your Gradle scripts

Gradle Plugin for Genymotion

Gradle Plugin Documentation

Here is a short description on how to use the Gradle plugin for Genymotion into your build.gradle.

Including the plugin

To use our plugin, you need first to reference our plugin’s repository. Here is what your build.gradle should look like:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.genymotion:plugin:1.4'
    }
}

Then, apply the plugin. Insert this line into your build.gradle:

apply plugin: "genymotion"

Using the plugin

When this is done you can access to the Genymotion’s Gradle features. You can open a genymotion section and start defining your devices like this:

genymotion {
    devices {
        nexus5 {
            template "Google Nexus 5 - 4.4.4 - API 19 - 1080x1920"
        }
    }
}

This simple example will create and launch a Nexus 5 running KitKat right before the connectedAndroidTest task.

You can also use the plugin to run your tests in Genymotion Cloud. To add a cloud device, use the following syntax:

genymotion {
    cloudDevices {
        nexus5 {
            template "Google Nexus 5 - 4.4.4 - API 19 - 1080x1920"
        }
    }
}

This will create a Nexus 5 device on Genymotion Cloud.

But this plugin can do a lot more, read the full documentation for an exhaustive explanation.

Downloading the plugin's source code

To download the plugin, run:

git clone --recursive https://github.com/Genymobile/genymotion-gradle-plugin.git

Project description

The plugin folder contains the Gradle plugin.

The samples folder contains the example project using the Gradle plugin. There is one sample called 'helloworld' that showcases how to use the Gradle plugin in the context of an Android app.

Compiling the plugin

To compile the plugin, go to the root project folder and run the following command:

./gradlew :plugin:uploadArchives

The build result is a Maven repository. It will be pushed into a new folder: repo

You can now use the plugin as a simple repository. To add it to your project, you must add these lines to your build.gradle file:

buildscript {
    repositories {
        maven { url uri('<path/to/local/repo>') }
    }
    dependencies {
        classpath 'com.genymotion:plugin:+'
    }
}

Give it a try

Execute the sample "helloworld" using this command:

cd samples/helloworld
./gradlew connectedAndroidTest

This starts a virtual device on your computer.

Contributing

The Gradle Plugin for Genymotion is an open source project under GPL v3 license.

Pull requests are strongly encouraged.

You can learn more about the plugin architecture in the architecture document.

Unit testing the project

Before pulling, you need to run the unit tests on the project. You can run it with the command:

./gradlew :plugin:test

As some tests are using the Android Gradle plugin, you need to have the Android SDK installed and the ANDROID_HOME environment variable set to be able to run all the tests.

Optional integration tests

This project also contains integration tests.

Before running these tests you need gmtool, the command line tool for Genymotion. It is embedded in the Genymotion app bundle.

The integration tests rely on a default.properties file where all needed properties can be read. This can be addressed in two ways. Either you create such file (ideal when working locally) or you inject all the needed properties via command line argument (ideal for CI):

Method 1:

  1. Copy the plugin/src/integTest/res/test/default.properties.TEMPLATE file and name it default.properties (in the same folder)
  2. Fill the new file with your information (genymotion username, password, license) and the path to your local Genymotion installation (genymotionPath).
  3. Also, in the file plugin/src/integTest/res/test/android-app/local.properties, set the sdk.dir field with your Android SDK path

Method 2:

Add the following command line arguments when running the tests:

./gradlew <taskName> -Pusername=<username> -Ppassword=<password> -Plicense=<license> -PgenymotionPath=<path-to-genymotion>

Then launch the integration tests with this command:

./gradlew :plugin:integrationTest

Or launch all the tests (unit & integration) with this command:

./gradlew :plugin:check

More Repositories

1

scrcpy

Display and control your Android device
C
99,612
star
2

gnirehtet

Gnirehtet provides reverse tethering for Android
Java
5,807
star
3

mirror

Easy reflection for Java and Android
Java
341
star
4

genymotion-kernel

C
89
star
5

genymotion-device-web-player

Genymotion Virtual Device Web Player
JavaScript
77
star
6

copydeps

Analyze and copy library dependencies of ELF binaries
Python
76
star
7

genymotion-binocle

Java
43
star
8

gm_pr

A multi project Github pull request viewer
Python
42
star
9

genymotion-saas-github-action

Set up your GitHub Actions workflow with a specific Genymotion Cloud SaaS
JavaScript
9
star
10

genymotion-cloud-ssl-tool

Shell
3
star
11

genymotion_platform_vendor_genymotion_security_public

This repo contains dev-keys and release-keys to sign Genymotion Desktop/Paas images.
Makefile
3
star
12

bitrise-step-genymotion-cloud-saas-stop

Go
2
star
13

f2ut_device_fairphone_FP2

C
2
star
14

bitrise-step-genymotion-cloud-saas-start

Go
2
star
15

genymotion-saas-orb

Shell
2
star
16

.github

Android as a Service
2
star
17

hiredis

C
2
star
18

f2ut_private_platform_manifest

2
star
19

f2ut_system_qcom

1
star
20

f2ut_platform_build

Makefile
1
star
21

f2ut_device_fairphone_sepolicy

1
star
22

f2ut_platform_frameworks_native

C++
1
star
23

f2ut_platform_vendor_fairphone

Makefile
1
star
24

f2ut_device_qcom_common

C
1
star
25

terraform-provider-genymotion

Terraform Genymotion provider. Please note: This Terraform provider is archived per our provider archiving process: https://terraform.io/docs/internals/archiving.html
Go
1
star
26

f2ut_platform_hardware_qcom_display

1
star
27

f2ut_platform_system_extras

1
star
28

f2ut_device_fairphone_common

1
star
29

f2ut_platform_vendor_cm

1
star
30

f2ut_platform_platform_bionic

C
1
star
31

f2ut_system_vold

1
star
32

f2ut_device_fairphone

1
star
33

f2ut_platform_frameworks_base

1
star
34

f2ut_system_core

C
1
star
35

f2ut_kernel_fairphone

C
1
star
36

f2ut_platform_frameworks_av

C++
1
star
37

bitrise-step-genymotion-saas-install-gmsaas-cli

Go
1
star
38

f2ut_platform_hardware_qcom_audio

1
star