title: How to run "adb push" command before launching an activity from Android Studio
body: <p>I have some test data for my program that i want to push to the device before a test activity is run or debug. On the command line this is:</p>
  <pre><code>adb -s  RF8M40T69JX  push --sync -z any test_data /storage/emulated/0/Download/test_data
  </code></pre>
  <p>I know i can run an external tool shell script with the &quot;Before launch&quot; configuration option. But this does not give me any way to know on which device Studio want to start it. I don't want to waste the time and dispatch to every possible device and every Edit-Compile-Run cycle.</p>
  <p>I checked that the device signature is unfortunately not passed as environment variable to external tools as it should be. Is there any other way? Can i do this with some Gradle magic?</p>