我已经运行了以下代码行和一些类似的解决方案,但似乎没有任何效果:
StringBuilder cmdOut = new StringBuilder();
Process process;
try {
process = Runtime.getRuntime().exec("adb shell");
InputStreamReader r = new
InputStreamReader(process.getInputStream());
BufferedReader bfreader = new BufferedReader(r);
char [] buf = new char[4096];
int nRead = 0;
while((nRead = bfreader.read(buf)) > 0)
{
cmdOut.append(buf,0,nRead);
}
bfreader.close();
try{
process.waitFor();
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
catch (IOException e)
{
e.printStackTrace();
}
but when i run this i got the following error:I have looked after every answer but I have not found any working solution
java.io.IOException: Cannot run program "adb": error=13, Permission denied
如果有人有任何可行的解决方案,请通过示例分享。
白衣非少年
相关分类