时间:2021-07-01 10:21:17 帮助过:19人阅读
Process process = null;
String osName = System.getProperty("os.name
");
String command = "/Users/zhouhaijun/androidsdk/android-sdk-macosx/platform-tools/adb devices"; //sdk所在位置
try
{
process=Runtime.getRuntime().exec(command);
InputStreamReader ir =new InputStreamReader(process.getInputStream());
LineNumberReader input= new LineNumberReader(ir);
String line;
while((line=input.readLine())!=null)
System.out.println(line);
}
catch(IOException e){
System.err.println("IOException"+e.getMessage());
}
System.out.println(osName+"/n");
}
}
本文出自 “知止内明” 博客,请务必保留此出处http://357712148.blog.51cto.com/6440370/1976023
mac java执行adb devices命令
标签:mac通过java执行adb devices命令