【问题标题】:Building a macOS commandline utility with a provisioning profile使用配置文件构建 macOS 命令行实用程序
【发布时间】:2020-02-20 08:32:48
【问题描述】:

我的目标是使用配置文件构建一个 macOS 命令行二进制文件(由于使用了 Apple 的新 Endpoint Security Framework,因此需要该配置文件)。

✅ 我已经创建并安装了 Provisioning Profile - 构建和运行 macOS 应用程序版本没有问题(Xcode 自动填充 "Provisioning Profile",在 "Signing and Capabilities" 下,当 "Bundle Identifier" 与安装的 Provisioning 中的匹配时简介):

但是,当尝试构建命令行版本时,此选项不会出现,因为 Xcode 认为 "None [is] Required"

无论如何,我都尝试通过项目的"Build Settings" 为目标指定配置文件:

❌ 但是构建失败: processMonitor does not support provisioning profiles. processMonitor does not support provisioning profiles, but provisioning profile Process Monitor has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor.

注意,项目的 Provisioning Profile(在"Build Settings" 下)设置为"Automatic"

❌ 我也没有通过xcodebuild 获得运气,这会产生同样的错误:

$ xcodebuild -project "processMonitor.xcodeproj" -scheme processMonitor -configuration Release PROVISIONING_PROFILE_SPECIFIER="Process Monitor" DEVELOPEMENT_TEAM="<team id>"
Build settings from command line:
    DEVELOPEMENT_TEAM = <team id>
    PROVISIONING_PROFILE_SPECIFIER = Process Monitor

note: Using new build system
note: Planning build
note: Constructing build description
error: processMonitor does not support provisioning profiles. processMonitor does not support provisioning profiles, ...

所以,问题是:是否可以构建需要配置文件的独立 macOS 命令行二进制文件? ......如果是这样,怎么办?

【问题讨论】:

  • 你用的是什么xcode版本
  • @AnjulaS:Xcode 版本 11.0 (11A420a)

标签: objective-c xcode macos


【解决方案1】:

FWIW,一个独立的 macOS 命令行二进制文件,如果它被打包在传统的“App Bundle”(.app) 文件夹结构中,但不是作为独立的单一二进制文件,可以使用配置文件进行代码签名和授权文件。

在 Apple 开发者论坛中发布了此过程的 Endpoint Security 示例:https://developer.apple.com/forums/thread/129596

TLDR 是使用 Xcode 构建一个成熟的“.app”项目,包括正确的权利、配置文件、代码签名配置,然后用所需的命令行二进制逻辑产生如下文件夹结构(来自上面的 Apple 开发者论坛帖子):

% find DaemonInAppsClothing.app
DaemonInAppsClothing.app
DaemonInAppsClothing.app/Contents
DaemonInAppsClothing.app/Contents/_CodeSignature
DaemonInAppsClothing.app/Contents/_CodeSignature/CodeResources
DaemonInAppsClothing.app/Contents/MacOS
DaemonInAppsClothing.app/Contents/MacOS/DaemonInAppsClothing
DaemonInAppsClothing.app/Contents/embedded.provisionprofile
DaemonInAppsClothing.app/Contents/Info.plist
DaemonInAppsClothing.app/Contents/PkgInfo

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-11
    相关资源
    最近更新 更多