diff options
Diffstat (limited to 'tools/idevicedate.c')
-rw-r--r-- | tools/idevicedate.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/idevicedate.c b/tools/idevicedate.c index e1fbc20..a9d78c1 100644 --- a/tools/idevicedate.c +++ b/tools/idevicedate.c @@ -59,6 +59,7 @@ static void print_usage(int argc, char **argv) printf("\n"); printf("OPTIONS:\n"); printf(" -u, --udid UDID\ttarget specific device by UDID\n"); + printf(" -n, --network\t\tconnect to network device\n"); printf(" -s, --set TIMESTAMP\tset UTC time described by TIMESTAMP\n"); printf(" -c, --sync\t\tset time of device to current system time\n"); printf(" -d, --debug\t\tenable communication debugging\n"); @@ -77,6 +78,7 @@ int main(int argc, char *argv[]) idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; int i; const char* udid = NULL; + int use_network = 0; time_t setdate = 0; plist_t node = NULL; int node_type = -1; @@ -104,6 +106,10 @@ int main(int argc, char *argv[]) udid = argv[i]; continue; } + else if (!strcmp(argv[i], "-n") || !strcmp(argv[i], "--network")) { + use_network = 1; + continue; + } else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--set")) { i++; if (!argv[i] || (strlen(argv[i]) <= 1)) { @@ -142,12 +148,12 @@ int main(int argc, char *argv[]) } } - ret = idevice_new(&device, udid); + ret = idevice_new_with_options(&device, udid, (use_network) ? IDEVICE_LOOKUP_NETWORK : IDEVICE_LOOKUP_USBMUX); if (ret != IDEVICE_E_SUCCESS) { if (udid) { - printf("No device found with udid %s, is it plugged in?\n", udid); + printf("No device found with udid %s.\n", udid); } else { - printf("No device found, is it plugged in?\n"); + printf("No device found.\n"); } return -1; } |