您需要使用该
exec(String[] cmdarray)函数来发送参数,该函数的单个参数版本会在空间上拆分字符串,如果路径中包含空格,则会带来麻烦。
您还需要指定完整路径(也许是/ usr / bin / adb?)。
像这样:
Process process = runtime.exec(new String[] {"/usr/bin/adb", "devices"});
您需要使用该
exec(String[] cmdarray)函数来发送参数,该函数的单个参数版本会在空间上拆分字符串,如果路径中包含空格,则会带来麻烦。
您还需要指定完整路径(也许是/ usr / bin / adb?)。
像这样:
Process process = runtime.exec(new String[] {"/usr/bin/adb", "devices"});