我无法从命令行构建 ipa 签名文件。先说一下我的环境:
1. 应用程序 我从模板“Master-Detail Application”中准备了一个简单的iPad应用程序。没有改变代码,没有改变设置。只是简单的新项目。
2.构建脚本 这是我的构建“脚本”
cd /Users/admin/Desktop/signtest/signtest/
xcodebuild -target signtest -configuration Debug -sdk iphonesimulator4.3 clean build
/usr/bin/xcrun -sdk iphoneos PackageApplication -v /Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app -o /Users/admin/Desktop/binaries/signtest.ipa --sign "iPhone Developer: Marcin Zyga (CLJR93MXJ6)" --embed "/Users/admin/Library/MobileDevice/Provisioning\ Profiles/94D99766-0268-4E0E-B8D1-053063BB2DA1.mobileprovision"
3.问题
应用程序已构建,然后我尝试从构建中创建一个 ipa 文件。但我有这个:
** BUILD SUCCEEDED **
Packaging application: '/Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app'
Arguments: embed=/Users/admin/Library/MobileDevice/Provisioning\ Profiles/94D99766-0268-4E0E-B8D1-053063BB2DA1.mobileprovision verbose=1 output=/Users/admin/Desktop/binaries/signtest.ipa sign=iPhone Developer: Marcin Zyga (CLJR93MXJ6)
Environment variables:
HOME = /Users/admin
SUDO_GID = 20
DISPLAY = /tmp/launch-vj2zx7/org.x:0
VERSIONER_PERL_PREFER_32_BIT = no
MAIL = /var/mail/root
SSH_AUTH_SOCK = /tmp/launch-YPyQMl/Listeners
PWD = /Users/admin/Desktop/signtest/signtest
LANG = pl_PL.UTF-8
USER = root
LOGNAME = root
__CF_USER_TEXT_ENCODING = 0x0:29:42
USERNAME = root
SHLVL = 1
OLDPWD = /SMT/ci_shell_scripts
_ = /usr/bin/xcrun
PATH = /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
LSCOLORS = GxFxCxDxBxegedabagaced
SUDO_USER = admin
SHELL = /bin/bash
TERM = xterm-256color
SUDO_COMMAND = ./sign_test_ipa.sh
VERSIONER_PERL_VERSION = 5.12
SUDO_UID = 502
Output directory: '/Users/admin/Desktop/binaries/signtest.ipa'
Temporary Directory: '/tmp/eiJTk08At3' (will NOT be deleted on exit when verbose set)
+ /bin/cp -Rp /Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app /tmp/eiJTk08At3/Payload
Program /bin/cp returned 0 : []
### Checking original app
+ /usr/bin/codesign --verify -vvvv /Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app
Program /usr/bin/codesign returned 1 : [/Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app: object file format unrecognized, invalid, or unsuitable
]
error: Codesign check fails : /Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app: object file format unrecognized, invalid, or unsuitable
重要的部分在这里:
Program /usr/bin/codesign returned 1 : [/Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app: object file format unrecognized, invalid, or unsuitable
]
error: Codesign check fails : /Users/admin/Desktop/signtest/signtest/build/Debug-iphonesimulator/signtest.app: object file format unrecognized, invalid, or unsuitable
我无法找到解决方案。
4. 我已经做过的事情 这里列出了我已经尝试过做的事情。但是,如果您确定我已经尝试过的事情可以解决我的问题,请逐步编写如何执行此操作(也许我之前做错了什么)。
- 该代码设计再次返回 1(对象 ifile 格式无效或不合适)问题- 添加了支持的代码行,完全没有效果
- Xcode - 共享应用程序 - PackageApplication 失败,退出代码 1 - 在构建设置中设置代码签名资源规则路径 $(SDKROOT)/ResourceRules.plist
iPhone 代码设计对象文件格式无效或不合适- 调用命令
sudo mv /usr/bin/codesign_allocate /usr/bin/codesign_allocate_old sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate /usr/bin
5. 我想要达到的目标 我正在尝试生成一个使用开发人员证书签名的 ipa 文件,以便我可以通过 iTunes 上传 ipa 文件以在设备上对其进行测试。
6. 对以下答案的回应
我已将构建命令行更改为:
xcodebuild -target signtest -configuration Debug -sdk iphoneos clean build
但现在我得到:
=== BUILD NATIVE TARGET signtest OF PROJECT signtest WITH CONFIGURATION Debug ===
Check dependencies
[BEROR]Code Sign error: Provisioning profile '94D99766-0268-4E0E-B8D1-053063BB2DA1' can't be found
** BUILD FAILED **
我已经在 xcode 中为此项目手动设置了配置文件。我已经仔细检查过,他们在那里。我在这里做错了什么?此外,当我使用附加设备进行构建时,一切正常,应用程序在我的 iPad 上启动。