diff options
Diffstat (limited to 'tools/idevicecrashreport.c')
| -rw-r--r-- | tools/idevicecrashreport.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/idevicecrashreport.c b/tools/idevicecrashreport.c index 0fc40c6..2945111 100644 --- a/tools/idevicecrashreport.c +++ b/tools/idevicecrashreport.c | |||
| @@ -309,6 +309,7 @@ static void print_usage(int argc, char **argv) | |||
| 309 | printf("\n"); | 309 | printf("\n"); |
| 310 | printf("OPTIONS:\n"); | 310 | printf("OPTIONS:\n"); |
| 311 | printf(" -u, --udid UDID\ttarget specific device by UDID\n"); | 311 | printf(" -u, --udid UDID\ttarget specific device by UDID\n"); |
| 312 | printf(" -n, --network\t\tconnect to network device\n"); | ||
| 312 | printf(" -e, --extract\t\textract raw crash report into separate '.crash' file\n"); | 313 | printf(" -e, --extract\t\textract raw crash report into separate '.crash' file\n"); |
| 313 | printf(" -k, --keep\t\tcopy but do not remove crash reports from device\n"); | 314 | printf(" -k, --keep\t\tcopy but do not remove crash reports from device\n"); |
| 314 | printf(" -d, --debug\t\tenable communication debugging\n"); | 315 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| @@ -331,6 +332,7 @@ int main(int argc, char* argv[]) | |||
| 331 | 332 | ||
| 332 | int i; | 333 | int i; |
| 333 | const char* udid = NULL; | 334 | const char* udid = NULL; |
| 335 | int use_network = 0; | ||
| 334 | 336 | ||
| 335 | #ifndef WIN32 | 337 | #ifndef WIN32 |
| 336 | signal(SIGPIPE, SIG_IGN); | 338 | signal(SIGPIPE, SIG_IGN); |
| @@ -350,6 +352,10 @@ int main(int argc, char* argv[]) | |||
| 350 | udid = argv[i]; | 352 | udid = argv[i]; |
| 351 | continue; | 353 | continue; |
| 352 | } | 354 | } |
| 355 | else if (!strcmp(argv[i], "-n") || !strcmp(argv[i], "--network")) { | ||
| 356 | use_network = 1; | ||
| 357 | continue; | ||
| 358 | } | ||
| 353 | else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { | 359 | else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { |
| 354 | print_usage(argc, argv); | 360 | print_usage(argc, argv); |
| 355 | return 0; | 361 | return 0; |
| @@ -389,12 +395,12 @@ int main(int argc, char* argv[]) | |||
| 389 | return 0; | 395 | return 0; |
| 390 | } | 396 | } |
| 391 | 397 | ||
| 392 | device_error = idevice_new(&device, udid); | 398 | device_error = idevice_new_with_options(&device, udid, (use_network) ? IDEVICE_LOOKUP_NETWORK : IDEVICE_LOOKUP_USBMUX); |
| 393 | if (device_error != IDEVICE_E_SUCCESS) { | 399 | if (device_error != IDEVICE_E_SUCCESS) { |
| 394 | if (udid) { | 400 | if (udid) { |
| 395 | printf("No device found with udid %s, is it plugged in?\n", udid); | 401 | printf("No device found with udid %s.\n", udid); |
| 396 | } else { | 402 | } else { |
| 397 | printf("No device found, is it plugged in?\n"); | 403 | printf("No device found.\n"); |
| 398 | } | 404 | } |
| 399 | return -1; | 405 | return -1; |
| 400 | } | 406 | } |
