summaryrefslogtreecommitdiffstats
path: root/tools/idevicescreenshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicescreenshot.c')
-rw-r--r--tools/idevicescreenshot.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/idevicescreenshot.c b/tools/idevicescreenshot.c
index c9dc0ef..75a69ce 100644
--- a/tools/idevicescreenshot.c
+++ b/tools/idevicescreenshot.c
@@ -50,6 +50,7 @@ int main(int argc, char **argv)
50 int result = -1; 50 int result = -1;
51 int i; 51 int i;
52 const char *udid = NULL; 52 const char *udid = NULL;
53 int use_network = 0;
53 char *filename = NULL; 54 char *filename = NULL;
54 55
55#ifndef WIN32 56#ifndef WIN32
@@ -70,6 +71,10 @@ int main(int argc, char **argv)
70 udid = argv[i]; 71 udid = argv[i];
71 continue; 72 continue;
72 } 73 }
74 else if (!strcmp(argv[i], "-n") || !strcmp(argv[i], "--network")) {
75 use_network = 1;
76 continue;
77 }
73 else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { 78 else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
74 print_usage(argc, argv); 79 print_usage(argc, argv);
75 return 0; 80 return 0;
@@ -88,11 +93,11 @@ int main(int argc, char **argv)
88 } 93 }
89 } 94 }
90 95
91 if (IDEVICE_E_SUCCESS != idevice_new(&device, udid)) { 96 if (IDEVICE_E_SUCCESS != idevice_new_with_options(&device, udid, (use_network) ? IDEVICE_LOOKUP_NETWORK : IDEVICE_LOOKUP_USBMUX)) {
92 if (udid) { 97 if (udid) {
93 printf("No device found with udid %s, is it plugged in?\n", udid); 98 printf("No device found with udid %s.\n", udid);
94 } else { 99 } else {
95 printf("No device found, is it plugged in?\n"); 100 printf("No device found.\n");
96 } 101 }
97 return -1; 102 return -1;
98 } 103 }
@@ -174,6 +179,7 @@ void print_usage(int argc, char **argv)
174 printf("the screenshotr service is not available.\n"); 179 printf("the screenshotr service is not available.\n");
175 printf("\n"); 180 printf("\n");
176 printf(" -u, --udid UDID\ttarget specific device by UDID\n"); 181 printf(" -u, --udid UDID\ttarget specific device by UDID\n");
182 printf(" -n, --network\t\tconnect to network device\n");
177 printf(" -d, --debug\t\tenable communication debugging\n"); 183 printf(" -d, --debug\t\tenable communication debugging\n");
178 printf(" -h, --help\t\tprints usage information\n"); 184 printf(" -h, --help\t\tprints usage information\n");
179 printf(" -v, --version\t\tprints version information\n"); 185 printf(" -v, --version\t\tprints version information\n");