如何在 Xcode 中为 iOS 应用程序找到 APP_UUID?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6861024/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 21:35:52  来源:igfitidea点击:

How do I find the APP_UUID in Xcode for an iOS App?

iosxcodeuuid

提问by Andrea

iOS Simulator stores apps in ~/Library/Application Support/iPhone Simulator/4.2/Applications/APP_UUID/

iOS Simulator 将应用程序存储在 ~/Library/Application Support/iPhone Simulator/4.2/Applications/APP_UUID/

But how do I find the APP_UUID for a specific Project/Target?

但是如何找到特定项目/目标的 APP_UUID?

回答by Antzi

Go to

~/Library/Developer/CoreSimulator/Devices/ 

and type

并输入

find . -iname "*.app"

in a shell.

在一个壳里。

** Updated for Xcode 8 **

** 针对 Xcode 8 更新 **

回答by Seamus Campbell

The easiest way I've found is to run the app in the simulator and NSLog the result of a standard path-locating function, like this one:

我发现的最简单的方法是在模拟器中运行应用程序并 NSLog 标准路径定位函数的结果,如下所示:

- (NSString *)applicationDocumentsDirectory {
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, 
                                                         NSUserDomainMask, 
                                                         YES);
    NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
    return basePath;
}

// elsewhere, like in -application:didFinishLaunching:withOptions:
NSLog(@"app doc directory: %@", [self applicationDocumentsDirectory]);

回答by Estev?o Lucas

Here is what you need:

这是您需要的:

xcrun simctl get_app_container booted com.bundle.identifier

just change com.bundle.identifierto your app bundle identifier

只需更改com.bundle.identifier为您的应用程序包标识符