Android - Interactive shell (Runtime.getRuntime().exec())
问题 How to run an interactive shell on android? (rooted device) I need the nexts steps: 1 - Execute shell process (onCreate) Process p = Runtime.getRuntime().exec(String[]{"su","-c","sh"}); 2 - Get the output (onCreate) BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream)); //dos is a field (a class attribute) dos = new DataOutputStream(p.getOutputStream()); new Thread(new Runnable() { @Override public void run() { String l; //wait the console output and write it while(