Search code examples
androidadbandroid-gradle-pluginbuild.gradle

copy file to android during tests


during the tests of my app, I need to copy video files from the project to device. I came up with this command:

    task copyFiles(type: Exec, dependsOn: 'installDebug') {
    commandLine 'adb', 'push', 'file', /data/local'     
}

but I don't know exactly where to put it and how to invoke it on tests...
Any ideas?


Solution

  • You cannot put file to /data/local (without hacks). You can put it to /sdcard (internal memory on newest devices or external sd-card on old devices)