Reputation: 77
I try run bash on android using next code:
Process proc = null;
try
{
proc = Runtime.getRuntime().exec("/bin/bash");
} catch (IOException e)
{
e.printStackTrace();
}
if (proc != null)
{
//some code
}else
System.out.println("NULL");
But proc always is null. What I do wrong?
Upvotes: 0
Views: 569
Reputation: 6798
Bash is usually not available on Android devices, and the location of the bin directory is different too. Try this one:
proc = Runtime.getRuntime().exec("/system/bin/sh");
Upvotes: 3