From 489a673aeeef4706af3986d41c24ab434e77d7d5 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 5 Jun 2020 20:50:34 +0200 Subject: tools: Unify --network command line switch and add it where missing --- tools/ideviceprovision.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tools/ideviceprovision.c') 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) printf("\n"); printf("The following OPTIONS are accepted:\n"); printf(" -u, --udid UDID target specific device by UDID\n"); + printf(" -n, --network connect to network device\n"); printf(" -x, --xml print XML output when using the 'dump' command\n"); printf(" -d, --debug enable communication debugging\n"); printf(" -h, --help prints usage information\n"); @@ -300,6 +301,7 @@ int main(int argc, char *argv[]) const char* udid = NULL; const char* param = NULL; const char* param2 = NULL; + int use_network = 0; #ifndef WIN32 signal(SIGPIPE, SIG_IGN); @@ -319,6 +321,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], "install")) { i++; if (!argv[i] || (strlen(argv[i]) < 1)) { @@ -437,12 +443,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; } -- cgit v1.1-32-gdbae