Richlewis
Richlewis

Reputation: 15374

Custom Gradle task hangs

I am putting together a Gradle task that will start an Android device using Genymotion. The task does launch the emulator but hangs at this stage:

Building 0% > :startEmulator

How do I tell it to continue once the emulator has launched? My task looks like:

task startEmulator(type: Exec) {
  executable 'sh'
  args "-c", "/Applications/Genymotion.app/Contents/MacOS/player.app/Contents/MacOS/player --vm-name 'Google Nexus 6P - 7.0.0 - API 24 - 1440x2560'"
}

Upvotes: 0

Views: 245

Answers (1)

Opal
Opal

Reputation: 84756

The task hangs since it probably works in foreground and does not exit. Gradle waits for this task to finish, so it waits forever. What might help here is to run the task in background. You may find this plugin useful.

Upvotes: 2

Related Questions