Android examples for Android OS:Shell
reboot Device via shell
//package com.java2s; import java.io.DataOutputStream; public class Main { static public void rebootDevice() { try {/*w w w . j av a2s. c o m*/ Process process = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream( process.getOutputStream()); os.writeBytes("reboot \n"); } catch (Throwable t) { t.printStackTrace(); } } }