diff options
| -rw-r--r-- | man/ideviceinstaller.1 | 3 | ||||
| -rw-r--r-- | src/ideviceinstaller.c | 22 |
2 files changed, 24 insertions, 1 deletions
diff --git a/man/ideviceinstaller.1 b/man/ideviceinstaller.1 index 8d2a01d..8ede2db 100644 --- a/man/ideviceinstaller.1 +++ b/man/ideviceinstaller.1 | |||
| @@ -31,6 +31,9 @@ list apps installed on the device. | |||
| 31 | .RS | 31 | .RS |
| 32 | .B Additional options: | 32 | .B Additional options: |
| 33 | .TP | 33 | .TP |
| 34 | \-b <bundleID> | ||
| 35 | Only query for given bundle identifier (can be passed multiple times) | ||
| 36 | .TP | ||
| 34 | \-o list_user | 37 | \-o list_user |
| 35 | list user apps only (apps installed by the user) | 38 | list user apps only (apps installed by the user) |
| 36 | .B This is the default. | 39 | .B This is the default. |
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c index 69ccf29..d80f04d 100644 --- a/src/ideviceinstaller.c +++ b/src/ideviceinstaller.c | |||
| @@ -120,6 +120,7 @@ int command_completed = 0; | |||
| 120 | int ignore_events = 0; | 120 | int ignore_events = 0; |
| 121 | int err_occurred = 0; | 121 | int err_occurred = 0; |
| 122 | int notified = 0; | 122 | int notified = 0; |
| 123 | plist_t bundle_ids = NULL; | ||
| 123 | 124 | ||
| 124 | static void print_apps_header() | 125 | static void print_apps_header() |
| 125 | { | 126 | { |
| @@ -400,6 +401,8 @@ static void print_usage(int argc, char **argv) | |||
| 400 | " -u, --udid UDID\tTarget specific device by UDID.\n" | 401 | " -u, --udid UDID\tTarget specific device by UDID.\n" |
| 401 | " -n, --network\t\tConnect to network device.\n" | 402 | " -n, --network\t\tConnect to network device.\n" |
| 402 | " -l, --list-apps\tList apps, possible options:\n" | 403 | " -l, --list-apps\tList apps, possible options:\n" |
| 404 | " -b, --bundle-identifier\tOnly query for given bundle identifier\n" | ||
| 405 | " (can be passed multiple times)\n" | ||
| 403 | " -o list_user\t- list user apps only (this is the default)\n" | 406 | " -o list_user\t- list user apps only (this is the default)\n" |
| 404 | " -o list_system\t- list system apps only\n" | 407 | " -o list_system\t- list system apps only\n" |
| 405 | " -o list_all\t- list all types of apps\n" | 408 | " -o list_all\t- list all types of apps\n" |
| @@ -448,12 +451,13 @@ static void parse_opts(int argc, char **argv) | |||
| 448 | { "notify-wait", no_argument, NULL, 'w' }, | 451 | { "notify-wait", no_argument, NULL, 'w' }, |
| 449 | { "debug", no_argument, NULL, 'd' }, | 452 | { "debug", no_argument, NULL, 'd' }, |
| 450 | { "version", no_argument, NULL, 'v' }, | 453 | { "version", no_argument, NULL, 'v' }, |
| 454 | { "bundle-identifier", required_argument, NULL, 'b' }, | ||
| 451 | { NULL, 0, NULL, 0 } | 455 | { NULL, 0, NULL, 0 } |
| 452 | }; | 456 | }; |
| 453 | int c; | 457 | int c; |
| 454 | 458 | ||
| 455 | while (1) { | 459 | while (1) { |
| 456 | c = getopt_long(argc, argv, "hU:li:u:g:La:r:R:o:nwdv", longopts, | 460 | c = getopt_long(argc, argv, "hU:li:u:g:La:r:R:o:nwdvb:", longopts, |
| 457 | (int *) 0); | 461 | (int *) 0); |
| 458 | if (c == -1) { | 462 | if (c == -1) { |
| 459 | break; | 463 | break; |
| @@ -493,6 +497,17 @@ static void parse_opts(int argc, char **argv) | |||
| 493 | case 'n': | 497 | case 'n': |
| 494 | use_network = 1; | 498 | use_network = 1; |
| 495 | break; | 499 | break; |
| 500 | case 'b': | ||
| 501 | if (!*optarg) { | ||
| 502 | printf("ERROR: bundle identifier must not be empty!\n"); | ||
| 503 | print_usage(argc, argv); | ||
| 504 | exit(2); | ||
| 505 | } | ||
| 506 | if (bundle_ids == NULL) { | ||
| 507 | bundle_ids = plist_new_array(); | ||
| 508 | } | ||
| 509 | plist_array_append_item(bundle_ids, plist_new_string(optarg)); | ||
| 510 | break; | ||
| 496 | case 'l': | 511 | case 'l': |
| 497 | cmd = CMD_LIST_APPS; | 512 | cmd = CMD_LIST_APPS; |
| 498 | break; | 513 | break; |
| @@ -776,6 +791,10 @@ run_again: | |||
| 776 | free(opts); | 791 | free(opts); |
| 777 | } | 792 | } |
| 778 | 793 | ||
| 794 | if (bundle_ids) { | ||
| 795 | plist_dict_set_item(client_opts, "BundleIDs", plist_copy(bundle_ids)); | ||
| 796 | } | ||
| 797 | |||
| 779 | if (!xml_mode) { | 798 | if (!xml_mode) { |
| 780 | instproxy_client_options_set_return_attributes(client_opts, | 799 | instproxy_client_options_set_return_attributes(client_opts, |
| 781 | "CFBundleIdentifier", | 800 | "CFBundleIdentifier", |
| @@ -1499,6 +1518,7 @@ leave_cleanup: | |||
| 1499 | free(appid); | 1518 | free(appid); |
| 1500 | free(options); | 1519 | free(options); |
| 1501 | free(bundleidentifier); | 1520 | free(bundleidentifier); |
| 1521 | plist_free(bundle_ids); | ||
| 1502 | 1522 | ||
| 1503 | if (err_occurred && !res) { | 1523 | if (err_occurred && !res) { |
| 1504 | res = 128; | 1524 | res = 128; |
