98
98
char const *target_filename = NULL ;
99
99
char const *upload_pathname = NULL ;
100
100
char *bundle_id = NULL ;
101
+ char *key = NULL ;
101
102
bool interactive = true ;
102
103
bool justlaunch = false ;
103
104
bool file_system = false ;
@@ -1706,13 +1707,16 @@ void get_battery_level(AMDeviceRef device)
1706
1707
void list_bundle_id (AMDeviceRef device)
1707
1708
{
1708
1709
connect_and_start_session (device);
1709
-
1710
- NSArray *a = [NSArray arrayWithObjects:
1711
- @" CFBundleIdentifier" ,
1712
- @" CFBundleName" ,
1713
- @" CFBundleDisplayName" ,
1714
- @" CFBundleVersion" ,
1715
- @" CFBundleShortVersionString" , nil ];
1710
+ NSMutableArray *a = [NSMutableArray arrayWithObjects:
1711
+ @" CFBundleIdentifier" ,
1712
+ @" CFBundleName" ,
1713
+ @" CFBundleDisplayName" ,
1714
+ @" CFBundleVersion" ,
1715
+ @" CFBundleShortVersionString" , nil ];
1716
+ if (key) {
1717
+ NSArray * ns_keys = [[NSString stringWithUTF8String: key] componentsSeparatedByString: @" &" ];
1718
+ [a addObjectsFromArray: ns_keys];
1719
+ }
1716
1720
NSDictionary *optionsDict = [NSDictionary dictionaryWithObject: a forKey: @" ReturnAttributes" ];
1717
1721
CFDictionaryRef options = (CFDictionaryRef)optionsDict;
1718
1722
CFDictionaryRef result = nil ;
@@ -2279,6 +2283,7 @@ void usage(const char* app) {
2279
2283
@" -f, --file_system specify file system for mkdir / list / upload / download / rm\n "
2280
2284
@" -F, --non-recursively specify non-recursively walk directory\n "
2281
2285
@" -j, --json format output as JSON\n "
2286
+ @" -k, --key keys for the properties of the bundle. Joined by '&' and used only with -B <list_bundle_id> and -j <json> \n "
2282
2287
@" --custom-script <script> path to custom python script to execute in lldb\n "
2283
2288
@" --custom-command <command> specify additional lldb commands to execute\n " ,
2284
2289
[NSString stringWithUTF8String: app]);
@@ -2336,13 +2341,14 @@ int main(int argc, char *argv[]) {
2336
2341
{ " app_deltas" , required_argument, NULL , ' A' },
2337
2342
{ " file_system" , no_argument, NULL , ' f' },
2338
2343
{ " non-recursively" , no_argument, NULL , ' F' },
2344
+ { " key" , optional_argument, NULL , ' k' },
2339
2345
{ " custom-script" , required_argument, NULL , 1001 },
2340
2346
{ " custom-command" , required_argument, NULL , 1002 },
2341
2347
{ NULL , 0 , NULL , 0 },
2342
2348
};
2343
2349
int ch;
2344
2350
2345
- while ((ch = getopt_long (argc, argv, " VmcdvunrILefFD:R:X:i:b:a:t:p:1:2:o:l:w:9BWjNs:OE:CA:" , longopts, NULL )) != -1 )
2351
+ while ((ch = getopt_long (argc, argv, " VmcdvunrILefFD:R:X:i:b:a:t:p:1:2:o:l:w:9BWjNs:OE:CA:k: " , longopts, NULL )) != -1 )
2346
2352
{
2347
2353
switch (ch) {
2348
2354
case ' m' :
@@ -2488,6 +2494,9 @@ int main(int argc, char *argv[]) {
2488
2494
}
2489
2495
[custom_commands appendFormat: @" %s \n " , optarg];
2490
2496
break ;
2497
+ case ' k' :
2498
+ key = optarg;
2499
+ break ;
2491
2500
default :
2492
2501
usage (argv[0 ]);
2493
2502
return exitcode_error;
@@ -2501,7 +2510,7 @@ int main(int argc, char *argv[]) {
2501
2510
2502
2511
if (!app_path && !detect_only && !command_only) {
2503
2512
usage (argv[0 ]);
2504
- on_error (@" One of -[b|c|o|l|w|D|R|e |9] is required to proceed!" );
2513
+ on_error (@" One of -[b|c|o|l|w|D|R|X|e|B|C |9] is required to proceed!" );
2505
2514
}
2506
2515
2507
2516
if (unbuffered) {
0 commit comments