首页 > 解决方案 > 为什么不会手动构建 iPadOS .app 安装?

问题描述

经过相当多的调查和测试后,重写并重新提交了这个问题。我没有说明我们试图在原始问题中避免 Xcode 突出这一事实。我希望有人知道在没有 Xcode 的情况下构建 iOS 应用程序。

我只是用 Xcode 来测试。我们使用一个简单的构建系统为 MacOS(我们的 pkg 安装良好)、Windows、Android、Linux 等构建了一个通用应用程序。除非绝对别无选择,否则我们没有必要仅仅为了使用 Xcode 而打破一个构建。我们的 MacOS app/pkg 不需要 Xcode。

我使用我的开发人员帐户手动构建、打包和签名 iOS 应用程序。我可以将我的 saxzez-client.app 拖放到 iPad Air 2 模拟器上,我看到它安装在那里。我检查了我的物理 iPad Air 2,发现我的配置文件已安装在那里。我将我的 iPad Air 2 连接到我的 Mac Mini M1 并将其拖放到 iPad Air 2 上。它无法安装。

这是我现在在 iPad Air 2 控制台上得到的错误输出:

default 22:55:00.406095-0500    installd    com.saxzez.client:7:5:1:1:Start : Install (New)
default 22:55:00.435293-0500    SpringBoard termination assertion efficacy for com.saxzez.client (app not found) changed to 3
default 22:55:00.441904-0500    installd    0x16f553000 +[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]: 77: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.YRAXDM/extracted/Saxzez-Client.app : 0xe8008015 (A valid provisioning profile for this executable was not found.)

和(后来抓住了这个)

default 23:03:39.060054-0500    securityd   trustd[116]/1#11 LF=0 copy_parent_certificates Error Domain=NSOSStatusErrorDomain Code=-34018 "Client has neither application-identifier nor keychain-access-groups entitlements" UserInfo={numberOfErrorsDeep=0, NSDescription=Client has neither application-identifier nor keychain-access-groups entitlements}
default 23:03:39.060822-0500    securityd   trustd[116]/1#11 LF=0 copy_parent_certificates Error Domain=NSOSStatusErrorDomain Code=-34018 "Client has neither application-identifier nor keychain-access-groups entitlements" UserInfo={numberOfErrorsDeep=0, NSDescription=Client has neither application-identifier nor keychain-access-groups entitlements}
default 23:03:39.062453-0500    trustd  cert[0]: IssuerCommonName =(path)[]> 0
default 23:03:39.063467-0500    installd    Trust evaluate failure: [leaf IssuerCommonName LeafMarkerOid SubjectCommonName]

下面是 codesign 命令的用法:

codesign -f -s "Apple Development: Bob Smith (XXXXXXXXXX) " Saxzez-Client.app

我的信息列表:

<?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>CFBundleDisplayName</key>
 <string>Saxzez Client</string>
 <key>CFBundleIdentifier</key>
 <string>com.saxzez.client</string>
 <key>CFBundleVersion</key>
 <string>1.0.423</string>
 <key>CFBundleShortVersionString</key>
 <string>1.0.423</string>
 <key>CFBundleExecutable</key>
 <string>Saxzez-Client</string>
 <key>CFBundleIconFiles</key>
 <array>
  <string>our-icon</string>
 </array>
 <key>LSRequiresIPhoneOS</key>
 <false/>
 <key>UIRequiredDeviceCapabilities</key>
 <array>
  <string>arm64</string>
  <string>metal</string>
  <string>wifi</string>
 </array>
 <key>UIRequiresPersistentWiFi</key>
 <true/>
 <key>UILaunchImageFile</key>
 <string>our-icon</string>
 <key>CFBundleName</key>
 <string>Saxzez Client</string>
</dict>
</plist>

我的 Saxzez-Client.app 目录包含以下内容:

ls -R
Saxzez-Client   Info.plist  _CodeSignature  our-icon.png    embedded.mobileprovision    en.lproj

./_CodeSignature:
CodeResources

./en.lproj:
InfoPlist.strings

标签: iosxcode

解决方案


好吧,我用这个工具为我构建的应用程序签名:https ://dantheman827.github.io/ios-app-signer/我的应用程序安装完美!所以,它必须与我正在使用的代码设计证书或相关的东西有关。好消息是我不需要使用 Xcode :)。已经很晚了,所以我明天会发布 ios-app-signer 发现的实际修复。

顺便说一句,我正在我的新 Mac M1 上构建和打包,只是不使用 Xcode。一旦我有了基本 .app 结构的模板,我希望只使用 Xcode 在模拟器上进行测试并推送到我的 iPad Air 2。MacOS 和 Android 也是如此(没有用于构建/打包的 Android Studio)。

更新: codesign 需要的是 entitlements.plist 文件。从 ios-app-signer 工具获得生成的 entitlements.plist 文件后,我可以从命令行进行签名,将其压缩为 .ipa 文件,然后它可以完美地安装在物理 iPad Air 2 上。


推荐阅读