gpt4 book ai didi

ios - Xcode 从命令行构建应用程序到 ipa

转载 作者:可可西里 更新时间:2023-11-01 04:48:33 26 4
gpt4 key购买 nike

我无法从命令行构建 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。我已经做过的事情这是我已经尝试做的事情的列表。但是,如果您确定我已经尝试过的方法可以解决我的问题,请逐步写下如何执行此操作(也许我之前做错了什么)。

<强>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 上启动。

最佳答案

您正在构建脚本中选择 iPhone Simulator SDK。切换到真正的SDK。

关于ios - Xcode 从命令行构建应用程序到 ipa,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8532750/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com