Running shell commands on the click of a button

792 Views Asked by At

I wish to reset an android device programmatically using :
adb shell recovery --wipe_data

1. What is the easiest way to do this ?

2. Will it require root/superuser access ?

1

There are 1 best solutions below

1
On

For running shell commands you can use Runtime class. For more information check the documentation

For example:

Runtime.getRuntime().exec("commands_here");