Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle, sending command to adb

Tags:

android

gradle

I need that every time before running the tests, run the task with the command for adb

adb shell pm reset-permissions

I tried doing this in my gradle file, it`s compilling, but how does it run?

buildscript {
...
}

android {
...
}

task resetPermission(type: Exec) {
    commandLine 'adb', 'shell', 'pm', 'reset-permissions'
}
like image 738
whalemare Avatar asked Oct 30 '22 03:10

whalemare


1 Answers

You'll need to edit your test running configurations, to add the task.

See my (similar) answer here : https://stackoverflow.com/a/35157119/4706693

like image 78
NSimon Avatar answered Nov 15 '22 07:11

NSimon