5

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'
}
whalemare
  • 863
  • 1
  • 9
  • 29

1 Answers1

2

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

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

Community
  • 1
  • 1
NSimon
  • 5,082
  • 2
  • 20
  • 34