1. Call the ADB command to install the app in Android development, install the app into the/system/app directory
/** * Install the app in use ADB command,this style is silent * * /private void Adbinstalltheapp () { // ADB push core code String command = "CP" + "the Android apk file path" + "/system/app"; Process process = NULL; DataOutputStream OS = null; try { process = Runtime.getruntime (). EXEC ("su");//The phone must be root,it can exctue the adb command OS = new DataOutputStream (Process.getoutputstream ()); Os.writebytes (Command + "\ n"); Os.writebytes ("exit\n"); Os.flush (); } catch (Exception e) { e.printstacktrace (); } }
2. If you need to restart your phone with adb reboot, you can use the following command
String command = "adb reboot";
Note: Using the ADB command-line command is not possible if the phone is already rooted otherwise, you cannot execute the Andy Board command