diff options
| author | 2020-06-05 20:50:34 +0200 | |
|---|---|---|
| committer | 2020-06-05 20:50:34 +0200 | |
| commit | 489a673aeeef4706af3986d41c24ab434e77d7d5 (patch) | |
| tree | 123022859215220cf7f10a483d02bffdf157a0ce /tools/ideviceprovision.c | |
| parent | 3aa4e243faa8198550cb2851cb6f0b9cbb293812 (diff) | |
| download | libimobiledevice-489a673aeeef4706af3986d41c24ab434e77d7d5.tar.gz libimobiledevice-489a673aeeef4706af3986d41c24ab434e77d7d5.tar.bz2 | |
tools: Unify --network command line switch and add it where missing
Diffstat (limited to 'tools/ideviceprovision.c')
| -rw-r--r-- | tools/ideviceprovision.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/ideviceprovision.c b/tools/ideviceprovision.c index 8cf3de6..c93a682 100644 --- a/tools/ideviceprovision.c +++ b/tools/ideviceprovision.c | |||
| @@ -72,6 +72,7 @@ static void print_usage(int argc, char **argv) | |||
| 72 | printf("\n"); | 72 | printf("\n"); |
| 73 | printf("The following OPTIONS are accepted:\n"); | 73 | printf("The following OPTIONS are accepted:\n"); |
| 74 | printf(" -u, --udid UDID target specific device by UDID\n"); | 74 | printf(" -u, --udid UDID target specific device by UDID\n"); |
| 75 | printf(" -n, --network connect to network device\n"); | ||
| 75 | printf(" -x, --xml print XML output when using the 'dump' command\n"); | 76 | printf(" -x, --xml print XML output when using the 'dump' command\n"); |
| 76 | printf(" -d, --debug enable communication debugging\n"); | 77 | printf(" -d, --debug enable communication debugging\n"); |
| 77 | printf(" -h, --help prints usage information\n"); | 78 | printf(" -h, --help prints usage information\n"); |
| @@ -300,6 +301,7 @@ int main(int argc, char *argv[]) | |||
| 300 | const char* udid = NULL; | 301 | const char* udid = NULL; |
| 301 | const char* param = NULL; | 302 | const char* param = NULL; |
| 302 | const char* param2 = NULL; | 303 | const char* param2 = NULL; |
| 304 | int use_network = 0; | ||
| 303 | 305 | ||
| 304 | #ifndef WIN32 | 306 | #ifndef WIN32 |
| 305 | signal(SIGPIPE, SIG_IGN); | 307 | signal(SIGPIPE, SIG_IGN); |
| @@ -319,6 +321,10 @@ int main(int argc, char *argv[]) | |||
| 319 | udid = argv[i]; | 321 | udid = argv[i]; |
| 320 | continue; | 322 | continue; |
| 321 | } | 323 | } |
| 324 | else if (!strcmp(argv[i], "-n") || !strcmp(argv[i], "--network")) { | ||
| 325 | use_network = 1; | ||
| 326 | continue; | ||
| 327 | } | ||
| 322 | else if (!strcmp(argv[i], "install")) { | 328 | else if (!strcmp(argv[i], "install")) { |
| 323 | i++; | 329 | i++; |
| 324 | if (!argv[i] || (strlen(argv[i]) < 1)) { | 330 | if (!argv[i] || (strlen(argv[i]) < 1)) { |
| @@ -437,12 +443,12 @@ int main(int argc, char *argv[]) | |||
| 437 | } | 443 | } |
| 438 | } | 444 | } |
| 439 | 445 | ||
| 440 | ret = idevice_new(&device, udid); | 446 | ret = idevice_new_with_options(&device, udid, (use_network) ? IDEVICE_LOOKUP_NETWORK : IDEVICE_LOOKUP_USBMUX); |
| 441 | if (ret != IDEVICE_E_SUCCESS) { | 447 | if (ret != IDEVICE_E_SUCCESS) { |
| 442 | if (udid) { | 448 | if (udid) { |
| 443 | printf("No device found with udid %s, is it plugged in?\n", udid); | 449 | printf("No device found with udid %s.\n", udid); |
| 444 | } else { | 450 | } else { |
| 445 | printf("No device found, is it plugged in?\n"); | 451 | printf("No device found.\n"); |
| 446 | } | 452 | } |
| 447 | return -1; | 453 | return -1; |
| 448 | } | 454 | } |
