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

ios – Xcode从命令行构建应用程序到ipa,第1张

概述我无法从命令行构建ipa签名文件.首先谈谈我的环境: 1.申请 我从模板“Master-Detail Application”准备了一个简单的iPad应用程序.在代码中没有更改,在设置中没有任何改变.只是简单的新项目. 2.构建脚本 这是我的构建“脚本” cd /Users/admin/Desktop/signtest/signtest/xcodebuild -target signtest 我无法从命令行构建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/adminSUDO_GID = 20disPLAY = /tmp/launch-vj2zx7/org.x:0VERSIONER_PERL_PREFER_32_BIT = noMAIL = /var/mail/rootSSH_AUTH_SOCK = /tmp/launch-YPyQMl/ListenersPWD = /Users/admin/Desktop/signtest/signtestLANG = pl_PL.UTF-8USER = rootLOGname = root__CF_USER_TEXT_ENCoding = 0x0:29:42USERname = rootSHLVL = 1olDPWD = /SMT/ci_shell_scripts_ = /usr/bin/xcrunPATH = /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/binLScolorS = GxFxCxDxBxegedabagacedSUDO_USER = adminSHELL = /bin/bashTERM = xterm-256colorSUDO_COMMAND = ./sign_test_ipa.shVERSIONER_PERL_VERSION = 5.12SUDO_UID = 502Output 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/PayloadProgram /bin/cp returned 0 : []### Checking original app+ /usr/bin/codesign --verify -vvvv /Users/admin/Desktop/signtest/signtest/build/DeBUG-iphonesimulator/signtest.appProgram /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,or unsuitable

重要的是这里:

Program /usr/bin/codesign returned 1 : [/Users/admin/Desktop/signtest/signtest/build/DeBUG-iphonesimulator/signtest.app: object file format unrecognized,or unsuitable    ]    error: Codesign check fails : /Users/admin/Desktop/signtest/signtest/build/DeBUG-iphonesimulator/signtest.app: object file format unrecognized,or unsuitable

我无法找到解决方案.

4.我已经做了什么
这是我已经尝试过的列表.但是,如果你确定我已经尝试过的东西是我的问题的解决方案,请逐步写下如何做到这一点(也许我之前做错了).

> That codesign returned 1 (object ifile format invalid or unsuitable) problem again – 添加了支持的代码行,完全没有效果
> Xcode – Sharing app – PackageApplication failed with exit code 1 – 在构建设置中设置代码签名资源规则$(SDKROOT)/ResourceRules.pList的路径
> iPhone Codesign object file format invalid or unsuitable – 调用命令

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开始.

解决方法 您正在构建脚本中选择iPhone Simulator SDK.将其切换到真正的SDK. 总结

以上是内存溢出为你收集整理的ios – Xcode从命令行构建应用程序到ipa全部内容,希望文章能够帮你解决ios – Xcode从命令行构建应用程序到ipa所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1045615.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存