Android Terminal and Log Dumping
- by J3hova
I am trying to send terminal commands programmaticly from an android activity. At the moment I'm using something like the following:
Process process = null;
DataOutputStream os = null;
process = Runtime.getRuntime().exec("su");
os = new DataOutputStream(process.getOutputStream());
os.writeBytes("./data/program1\n");
os.writeBytes("./data/program2\n");
os.writeBytes("exit\n");
os.flush();
However, my program1 is failing to run successfully and I believe it is due to inadequate user permissions. Now for my question:
Does anyone know how I can dump the terminal to a file and save it on the phone or sdcard? The program is tying into the terminal to feed it commands, I want to know a way to open a connection the otherway and access the (what is normally visual on a terminal screen) output.