I have an automation script written in java. Here is the code sample.
String command = "adb shell date > date.txt";
Process process = Runtime.getRuntime().exec(command);
When executing the code in windows its working fine but when I am running it in mac its not working properly. Later I found that, in windows this command execution is creating file in my local PC project directory. But in case of Mac its failed when trying to create the file in device directory and error showing. While from Mac terminal its working fine.
My question is why is not working in my mac machine and why file is not creating in my local PC?