1

I'm wondering if Cordova or any plugin for Cordova enables me to execute a command in the android shell? Similar to doing adb shell myCoolBinary -doThisStuff on a desktop machine connected to the phone.

Googling for this only returns tutorials for how to use the Cordova cli desktop application, which absolutely NOT what I'm looking for. I want to execute commands ON the phone.

turtle
  • 1,619
  • 1
  • 14
  • 30
timonsku
  • 1,249
  • 2
  • 21
  • 45

1 Answers1

1

I ended up writing my own plugin. I mostly put it together from another question that was about doing root shell executes from within your android app. I just adapted it to cordova.

I don't have the time to make this nice so here is a gist: https://gist.github.com/PTS93/d78ee885ee0c2f74892434008a953f8c

Just replace the files with the files from this plugin template: https://github.com/don/cordova-plugin-hello

You can then in your cordova app call this:

shell.execute("your shell command", success, failure);
Community
  • 1
  • 1
timonsku
  • 1,249
  • 2
  • 21
  • 45