3

need help with Gradle tasks. I need to run some "taskX" after an app was installed (after "installDebug" task). I've also tried to make the task like this:

task taskX(type: Exec, dependsOn: 'installDebug') {
     commandLine 'sh', './myScript.sh'
}

but it didn't execute. I actually can do this by Android Studio build configuration, but I also want to do this by Gradle wrapper.

Warble
  • 135
  • 1
  • 11
  • 2
    you are not using the correct task dependency type: `taskX.dependsOn installDebug` means "if I execute task *taskX* then task *installDebug* must be executed first. you need to use finalizer task dependency type ( see https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:finalizer_tasks ), e.g.: `installDebug.finalizedBy taskX` – M.Ricciuti Nov 27 '18 at 21:15
  • @Warble how would you run a command after installation through build config? – NoHarmDan Oct 02 '19 at 12:18

0 Answers0