android應用程序中調用shell命令

String cmd = “echo 1 > /sys/class/leds/red/brightness”;

String cmds[] = {"/bin/sh","-c",cmd};

Runtime.getRuntime().exec(cmds);

你可能感兴趣的:(android應用程序中調用shell命令)