工具:idea, andriod stutdio
使用command:adb shell getprop rp.build.version.release
执行Runtime.getRuntime().exce(command) 时报错:
caused by:java.io:Cannot run program "adb": error =2,No such file or directory
......
caused by:java.io:: error =2,No such file or directory
解决方法:command 前面加上 adb 工具的绝对路径。
/Users/xxxxx/Library/Android/sdk/platform-tools
Runtime.getRuntime().exce("/Users/xxxxx/Library/Android/sdk/platform-tools"+command)