Reputation: 2394
I'm writing some tests in Android Studio with Robotium. In my test file I'd like to execute a shell script that prepares the right environment on our server. I don't work in Java/AndroidStudio so this is completely new territory. Is it possible to execute a shell script?
I found some code, but java doesn't recognize commandLine
commandLine 'sh', './myScript.sh'
Any help greatly appreciated.
Upvotes: 2
Views: 5195
Reputation: 2394
ProcessBuilder pb = new ProcessBuilder("myshellScript.sh", "myArg1", "myArg2");
will do the trick
Upvotes: 3