int recovery_cmd(string *args, struct shell_state *sh) { if ( args[1] == "" ) { ifNotQuiet cout << "Please provide a command to send to the phone." << endl; return SHELL_CONTINUE; } string cmd = ""; for (int i=1; args[i] != ""; i++) { cmd += args[i]; if (args[i + 1] != "") { cmd += " "; } } mach_error_t retval = sendCommandToDevice( sh->recovery_dev, CFStringCreateWithCString(NULL, cmd.c_str(), kCFStringEncodingASCII) ); ifVerbose cout << "cmd: " << cmd << ": " << retval << endl; return SHELL_CONTINUE; }