Giter Club home page Giter Club logo

genymotion-gradle-plugin's Introduction

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

genymotion-gradle-plugin's People

Contributors

agateau-g avatar agavignet avatar amasciulli avatar amooregeny avatar bryant1410 avatar cedriccabessa avatar eyal-lezmy avatar flo-genymobile avatar genypaul avatar jonathanklee avatar julienbolard avatar odabonot avatar qfarizon avatar sgaland avatar srats avatar thomascarpentier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

genymotion-gradle-plugin's Issues

Possibility to run genymotion ONLY on CI host

I am using Genymotion on a CI host using the Gradle plugin to run instrumentation tests. This is working well.

However, when I'm developing on my workstation, I'd like to use a real device instead of genymotion, also from a license perspective. I want Genymotion to be restricted to the CI host.

When I try to run instrumentation tests on my workstation, the build will fail because genymotion is not installed:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':service'.
> Failed to notify project evaluation listener.
   > gmtool command not found. You have to specify the Genymotion path with the genymotion.config.genymotionPath parameter. Current value: /Applications/Genymotion.app/Contents/MacOS/

Is there a way to configure the Gradle plugin to only be active based on the host that is running the build, or maybe an environment variable?

GMTool command failed. Error code: 6.Failed to log user

We are getting a bunch of error messages on our build machines that say Wrong Username or Password. It is sporadic and not happens about 50 percent of the time. It causes our build to crash. We add the license, username, and password by adding it in a grade.properties as follows. I have attached a screenshot of the full stacktrace too. We would like to get this fixed asap.

Thanks in advance,

04-Dec-2015 11:42:26 FAILURE: Build failed with an exception. 04-Dec-2015 11:42:26 04-Dec-2015 11:42:26 * What went wrong: 04-Dec-2015 11:42:26 A problem occurred configuring project ':main:WorkdayApp'. 04-Dec-2015 11:42:26 > Failed to notify project evaluation listener. 04-Dec-2015 11:42:26 > GMTool command failed. Error code: 6.Failed to log user 04-Dec-2015 11:42:26 Failed to retrieve template list. 04-Dec-2015 11:42:26 04-Dec-2015 11:42:26

screen shot 2015-12-04 at 11 55 55 am

Not possible to list tasks on project without genymotion credentials

For a project with multiple contributors it's not realistic to expect everyone to have Genymotion or want to use genymotion as their debugging platform and rather use devices or plain emulator.

Currently, if you specify the genymotion gradle configuration it will fail during task creation since it can't login without credentials.
The genymotion tasks should not login until they're executed, both to avoid the unnecessary network delays and to allow other developers to use the rest of the project.

Error from gradle: gmtool command not found. You have to specify the Genymotion path with the genymotion.config.genymotionPath parameter.

unable to use this plugin with my android app. Running Android Studio 1.1.0, Android-Gradle plugin v.1.10, : build.gradle is:

buildscript {
ext.kotlin_version = '0.10.770'
ext.junit_version = '4.12'
ext.rxjava_version = '1.0.7'
ext.rxandroid_version = '0.24.0'
ext.retrofit_version = '1.9.0'
ext.kk_version = '0.1.0-SNAPSHOT'

repositories {
    mavenCentral()
    maven { url 'http://oss.sonatype.org/content/repositories/snapshots' }
    maven { url  "http://dl.bintray.com/genymobile/Genymotion" }
}

dependencies {
    classpath 'com.android.tools.build:gradle:1.1.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.genymotion:plugin:0.1'
}

}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.genymotion.gradleplugin'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.scoir.rxandroidkotlin"
    minSdkVersion 15
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
    androidTest.java.srcDirs += 'src/androidTest/kotlin'
    test.java.srcDirs += 'src/test/kotlin'
}

}

repositories {
mavenCentral()
maven { url 'http://oss.sonatype.org/content/repositories/snapshots' }
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "com.jakewharton:kotterknife:$kk_version"

}

Jenkins error: GMTool command failed. Error code: 3.Failed to launch virtual device: nexus5

Trying to run Genymotion in Jenkins. However, the emulator won't startup. The emulator works fine when started manually.

  • I've put the Genymotion.app and Genymotion Shell inside /Users/Shared/ so that the Jenkins user has access to it.
  • The device is listed:
    screenshot 2016-01-22 09 25 49
  • And the device starts when clicked manually:
    screenshot 2016-01-22 09 27 12
genymotion {
    devices {
        nexus5 {
            template "Google Nexus 5 - 5.0.0 - API 21 - 1080x1920"
            deleteWhenFinish false
        }
    }
    config {
        genymotionPath = "/Users/Shared/Genymotion.app/Contents/MacOS/"
        username = "XXX"
        password = "XXX"
        license = "XXX"
    }
}
:everstore:genymotionLaunchConnectedDebugAndroidTest
com.genymotion.tools.GMToolException: GMTool command failed. Error code: 3.Failed to launch virtual device: nexus5

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
    at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:71)
    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:81)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
    at com.genymotion.tools.GMTool.handleExitValue(GMTool.groovy:1107)
    at com.genymotion.tools.GMTool$handleExitValue$3.callCurrent(Unknown Source)
    at com.genymotion.tools.GMTool.cmd(GMTool.groovy:1012)
    at com.genymotion.tools.GMTool$cmd$9.callCurrent(Unknown Source)
    at com.genymotion.tools.GMTool.cmd(GMTool.groovy:971)
    at com.genymotion.tools.GMTool.cmd(GMTool.groovy)
    at com.genymotion.tools.GMTool$cmd$8.callCurrent(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
    at com.genymotion.tools.GMTool.startDevice(GMTool.groovy:752)
    at com.genymotion.tools.GMTool$startDevice$16.callCurrent(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
    at com.genymotion.tools.GMTool.startDevice(GMTool.groovy:748)
    at com.genymotion.tools.GMTool.startDevice(GMTool.groovy)
    at com.genymotion.model.GenymotionVDLaunch.start(GenymotionVDLaunch.groovy:134)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:207)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:68)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
    at com.genymotion.tasks.GenymotionLaunchTask.processDevice(GenymotionLaunchTask.groovy:83)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:382)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1015)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
    at com.genymotion.tasks.GenymotionLaunchTask$_exec_closure2.doCall(GenymotionLaunchTask.groovy:59)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:292)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1015)
    at groovy.lang.Closure.call(Closure.java:423)
    at groovy.lang.Closure.call(Closure.java:439)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1379)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1372)
    at org.codehaus.groovy.runtime.dgm$149.invoke(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at com.genymotion.tasks.GenymotionLaunchTask.exec(GenymotionLaunchTask.groovy:58)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:62)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
    at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:155)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:152)
    at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:33)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:100)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:94)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:94)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
    at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:77)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:47)
    at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
    at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
An error occured. Stopping and deleting all launched devices, if needed.
:everstore:genymotionLaunchConnectedDebugAndroidTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':everstore:genymotionLaunchConnectedDebugAndroidTest'.
> com.genymotion.tools.GMToolException: GMTool command failed. GMTool command failed. Error code: 3.Failed to launch virtual device: nexus5

android.system.uid

Can I have a copy of genymobile Android 7.0 system< platform.pem > <platform.x509>

Delete sdcard directory before running tests

Hi there, I am using this plugin to run tests on a few build machine. During the tests we are storing images on the sdcard and then copying them to a server.

The problem we are having is that if a emulator crashes during running our tests, we are not able to delete the images off the device (considering it is not running anymore). Then the next time that emulator is started for tests, there are still images on the sdcard that are unwanted images -- they will skew the test results.

We want to add a deleteImages task that runs after the emulator is started but before tests are run. There doesn't seem like an easy way to do that. Any help would be much appreciated.

Unable to launch genymotion emulator automatically via my project build.gradle file

Hi Team,

I got a trial version of licensed/enterprise genymotion tool and wanted to see if it can launch the emulator automatically and run my instrumentation/android functional tests. Am not sure what am missing in my build.gradle file but i do not see the emulator being launched. Here is my build.gradle file and test command am trying on my project.

Build.Gradle:
buildscript {
    dependencies {
        ...
        classpath 'com.genymotion:plugin:1.0'
    }

    repositories() {
        mavenLocal();
        maven {
            ...
        }
        mavenCentral();
        flatDir {
            dirs 'libs'
        }
        jcenter()
    }
}

...
apply plugin: 'genymotion'

genymotion {
    config {
        genymotionPath "/Applications/Genymotion.app/Contents/MacOS/"
        taskLaunch "runTest"
    }
    devices {
        nexus7 {
            template "Google Nexus 7 - 4.4.4 - API 19 - 800x1280"
            productFlavors "emulatorMockIControl"
            deleteWhenFinish false
        }
    }
}

...

Command to run tests:
./gradlew spoonEmulatorMockIControlDebugAndroidTestSmall

Notes:
When i manually launch the emulator and run above command, all instrumentation tests execute as expected.

Any inputs on this issue are highly appreciated. This will help us in making a decision if we need to spend money in the licensed version of genymotion tool.

Thanks,
Pavan

How can I start/stop the emulator only once in a multi-library project?

For my multi-library Gradle-based Android project, each sub-project has tests, I'm trying to get the emulator to start before all tests and stop after all tests.

It's easy enough to get it to start and stop around each set of tests (by adding it to each library), but to make it start and stop once for the entire build, all I seem to be able to do is add a 'genymotionLaunch' and 'genymotionFinish' on either side of my command-line targets and tell the top level build file about it.

I was fiddling for ages yesterday, expecting a 'connectedCheck' target to exist at the top level, trying to make it depend on 'genymotionLaunch/Finish', with all sub-projects' 'connectedCheck' targets between them, but "gradle.plugin.com.dorongold.plugins:task-tree:1.0.1" strongly suggested that Gradle somehow offers 'connectedCheck' to each submodule in turn, with no corresponding top-level target (and I was unable to create that task, because the top level project appears to be evaluated completely before subprojects are considered, so subprojects{} didn't give me access).

Is there a way to hook into some top-level 'connectedCheck' task, or is the additional targets route the most sensible?

Thanks.

Setting processTimeout gives Error code: 143

Whenever I try to set the processTimeout Gradle in Android Studio refreshes with no problem but when I run the test I get:

A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > GMTool command failed. Error code: 143.

My build.gradle

...
genymotion {
    config {
        genymotionPath = "/Applications/Genymotion.app/Contents/MacOS/"
        verbose = true
        processTimeout = 1000
        taskLaunch = "connectedAndroidTestOriginalDebug"
    }
    devices {
        Nexus5 {
            template "Google Nexus 5 - 4.4.4 - API 19 - 1080x1920"
            clearLogAfterBoot true
            stopWhenFinish true
        }
    }
}
...

Gradle 1.3 Uptake

Currently this plugin will break when using the com.android.tools.build:gradle1.3 and above. This is a result of a change in the naming conventions of the test tasks.

Old : connectedAndroidTest{buildVariant}
new : connected{buildVariant}AndroidTest

Genymotion emulator crashing

genymotion {
    devices {
        nexus5 {
            template "Google Nexus 5 - 5.1.0 - API 22 - 1080x1920"
            deleteWhenFinish false
        }
    }
    config {
        genymotionPath = "/Applications/Genymotion.app/Contents/MacOS/"
        taskLaunch = "assembleDebugAndroidTest"
        username = "myuser"
        password = "password"
        license = "mylicense"
    }
}

I want an emulator to start up every time I run my test suite. The task that run the tests are
1:42:14 PM Executing tasks: [:main:assembleDebug, :main:assembleDebugAndroidTest]

The emulator starts up in time and opens. Then it appears that a second genymotion emulator starts (a second white genymotion icon pops up in the dock and then immediately crashes the other emulator). Then the build finishes and it doesn't have any devices to run on. Is this a known issue or am I doing something wrong?

Edit: Added --debug to the logs and found this
13:55:12.175 [INFO] [genymotion-logger] nexus5 already exists. A new device won't be created before launch and template is ignored

Error while assigning multiple values for taskLaunch genymotion property

genymotion{
config {
genymotionPath "/Applications/Genymotion.app/Contents/MacOS/"
taskLaunch ["spoonMockTestDebugAndroidTestSmall", "spoonMockTestDebugAndroidTestMedium"]
verbose true
abortOnError false
}
....
}

If you look at the above code, am assigning multiple values to taskLaunch config property as you have suggested in following issue:
#7

However when i do that and try to run one of the tasks using gradle command "./gradlew spoonMockTestDebugAndroidTestSmall", i see following error:
**A problem occurred evaluating project ':App'.

Cannot cast object 'spoonMockTestDebugAndroidTestSmall' with class 'java.lang.String' to class 'int'**

Can you please provide your inputs?

Appreciate your help in advance.

Thanks
Pavan

always tips error

Error:Cause: gmtool command not found. You have to specify the Genymotion path with the genymotion.config.genymotionPath parameter.

but i have define this:
genymotion {
config {
genymotionPath = "/Applications/Genymotion.app/Contents/MacOS/"
}
}

Bug in genymotion player

The last couple of week I was not able to use personal development genymotion because of Genymotion player not working.
I am terrifying what is the problem.
In my virtual box run properly but does not show image of Genymotion player.
So could you help?
I am attaching snapshot which will more clear about the problem.

  1. Here I got stuck.
    screenshot from 2017-03-14 11-21-40
    screenshot from 2017-03-14 11-23-50
    screenshot from 2017-03-14 11-25-01
    screenshot from 2017-03-14 11-38-38

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.