Codesign without xcode - 错误代码对象根本没有签名

问题描述:

我有一个在非xcode工具中开发的macOS .app。我想签署它,所以用户可以从我的网站下载。Codesign without xcode - 错误代码对象根本没有签名

我手动创建我的“的info.plist”文件,该文件是这样的:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0"> 
<dict> 
    <key>CFBundleDevelopmentRegion</key> 
    <string>English</string> 
    <key>CFBundleExecutable</key> 
    <string>mydemo</string> 
    <key>CFBundleName</key> 
    <string>md</string> 
    <key>LSApplicationCategoryType</key> 
    <string></string> 
    <key>CFBundleIdentifier</key> 
    <string>com.company.mydemo</string> 
    <key>CFBundleInfoDictionaryVersion</key> 
    <string>6.0</string> 
    <key>CFBundlePackageType</key> 
    <string>APPL</string> 
    <key>CFBundleSignature</key> 
    <string>md</string> 
    <key>CFBundleShortVersionString</key> 
    <string>1.0</string> 
    <key>CFBundleVersion</key> 
    <string>1</string> 
    <key>CFBundleIconFile</key> 
    <string>mydemo.icns</string> 
    <key>CSResourcesFileMapped</key> 
    <true/> 
    <key>CFBundleDocumentTypes</key> 
    <array> 
     <dict> 
      <key>CFBundleTypeRole</key> 
      <string>Viewer</string> 
      <key>CFBundleTypeExtensions</key> 
      <array> 
       <string>*</string> 
      </array> 
      <key>CFBundleTypeOSTypes</key> 
      <array> 
       <string>fold</string> 
       <string>disk</string> 
       <string>****</string> 
      </array> 
     </dict> 
    </array> 
    <key>NSHighResolutionCapable</key> 
    <true/> 
</dict> 
</plist> 

我有一个苹果开发者帐户,并在 https://developer/apple/account/mac/certificate遵循创建开发者ID应用证书的说明。

我现在做这个

codesign -s "Certificate Developer ID Company Name" mydemo.app 

,但得到的错误

mydemo.app:代码对象未签名的所有成分: mydemo.app/Contents/info.plist

我的.app文件没有包含在其他库中 - 只是可执行文件mydemo.app/Contents/MacOS/mydemo

我想成功签署mydemo.app。我在mydemo.zip发布我的应用程序,我的目标是当人们下载时。解压缩,并将其拖入/应用程序将运行更容易

info.plist文件名应大写:

Info.plist 

应该修正之后没有问题协同设计。

+1

非常感谢 - 一切似乎现在正常工作,就像你说的那样:) – Tom