I tried below code to get the output of the ran command. But it printing empty.
String cmd = "/bin/bash device_id -l";
Process process = Runtime.getRuntime.exec(cmd);
BufferedReader reader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
String line;
while ((line = reader.readLine()) != null) {
System.out.println(line);
}
reader.close();
Could anyone please help me. I have to get the connected iDevice UDID.
String cmd = "device_id -l";String cmd = "ps -ef";and got output in stdout. Maybe your command writes in stderr?