title: How to retrieve path to ADB in build.gradle
body: <p>I trying to start application via <code>gradle</code> <code>task</code>. </p>
  
  <pre><code>
  task runDebug(dependsOn: ['installDebug', 'run']) {
  }
  
  task run(type: Exec) {
  commandLine 'adb', 'shell', 'am', 'start', '-n', 'com.example.myexample/.ui.SplashScreenActivity'
  }
  </code></pre>
  
  <p>But this code don't work and i get error:<br/>
  <code>a problem occurred starting process 'command 'adb''</code><br/><br/>
  However, when i specify the path to adb explicitly, application is started.<br/></p>
  
  <pre><code>
  task run(type: Exec) {
      commandLine 'D:\\android\\android-studio\\sdk\\platform-tools\\adb', 'shell', 'am', 'start', '-n', 'com.example.myexample/.ui.SplashScreenActivity'
  }
  </code></pre>
  
  <p>So how can i get a variable which contains the path and transfer it to <code>commandLine</code>? </p>