简体   繁体   中英

Can I get the UUID of an installed iOS app?

We build new .ipa's for our app every day, and we want to run automated tests on each new .ipa that gets created. We're using ant scripts hooked up to Atlassian Bamboo to do this. My ant script is working fine for the most part, but I need to copy files from an iOS device onto a host computer.

The filepath for our app on an iphone is something like this:

/private/var/mobile/Applications/BE56F3B3-9AAD-446C-B6EE-A3DE4C848D16/Documents/${file_to_copy_from_iphone}

That ugly UUID jumble in the middle can be different for each .ipa we make. Is there a way I can install a .ipa to an iphone, THEN find out what its UUID is? Perhaps through the command line? I want to store it somehow so I can write something like this in my ant script:

/private/var/mobile/Applications/${uuid}/${filename}

Maybe this will help. From inside the app, you can get the absolute path for the running app. From there you should be able to parse out the value you need.

NSString *executablePath = [NSString stringWithCString:[[[[NSProcessInfo processInfo] arguments] objectAtIndex:0]
                                                      fileSystemRepresentation] encoding:NSUTF8StringEncoding];
NSLog(@"executablePath: %@", executablePath);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM