Starting Emulator


I’m traing to make a new task. This task should start the emulator android virtual machine. Then intall the apk and so on. But when I use this task:

task startAVD (type: Exec){ commandLine 'emulator', '-avd', 'AVD' }

It never end - I know Gradle is waiting for this task to end to go on and I really don’t know what to do about it. Can enyone help? Thanks a lot!

best regards,
a new Gradle enthusiast