【问题标题】:Xcode building application to ipa from command lineXcode 从命令行构建应用程序到 ipa
【发布时间】:2012-01-21 21:30:33
【问题描述】:

我无法从命令行构建 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 上启动。

【问题讨论】:

    标签: ios xcode continuous-integration building


    【解决方案1】:

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

    【讨论】:

    • 好的,我已将构建行更改为:xcodebuild -target signtest -configuration Debug -sdk iphoneos clean build,现在我得到:=== BUILD NATIVE TARGET signtest OF PROJECT signtest WITH CONFIGURATION Debug = ==检查依赖项[BEROR]代码签名错误:找不到配置文件“94D99766-0268-4E0E-B8D1-053063BB2DA1”**构建失败**我检查了配置文件,它就在那里。我已在 Xcode 中配置项目以使用此配置文件进行构建。我如何从命令行配置它?
    • 更新了我的问题以反映变化。
    • 你现在有一个不同的问题。您不应编辑此问题以将其更改为其他问题,而应发布一个新问题。
    • 我这样做并接受您的回答,因为它似乎是正确的。
    猜你喜欢
    • 2012-01-21
    • 1970-01-01
    • 2012-01-10
    • 2021-03-07
    • 1970-01-01
    • 2013-09-25
    • 2015-04-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多