Android examples for Android OS:Shell
delete User from shell
//package com.java2s; import java.io.DataOutputStream; import java.io.IOException; public class Main { public static void deleteUser(String id) { Process p;//from w w w .j ava 2s . c om try { p = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(p.getOutputStream()); os.writeBytes("pm remove-user " + id + "\n"); os.writeBytes("exit\n"); os.flush(); } catch (IOException e) { e.printStackTrace(); } } }