Xcode 的 PackageApplication 的替代品是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43094380/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What's the replacement for Xcode's PackageApplication?
提问by asp_net
With Xcode 8.3 PackageApplication is gone. I did use it to convert an *.app package/directory to a *.ipa file (after re-signing):
随着 Xcode 8.3 PackageApplication 消失了。我确实使用它将 *.app 包/目录转换为 *.ipa 文件(重新签名后):
xcrun -sdk iphoneos PackageApplication -v "MyApp.app" -o "MyApp.ipa"
Is there any replacement for this, so I can continue to convert .app to .ipa?
是否有任何替代品,以便我可以继续将 .app 转换为 .ipa?
回答by asp_net
Apparently there is no need to use any other tool, and it's also not necessary to change the process that leads to the *.app package (in other words: no need to use xcodebuild -exportArchive
).
显然不需要使用任何其他工具,也不需要更改导致 *.app 包的过程(换句话说:不需要使用xcodebuild -exportArchive
)。
All we have to do, is to zip that *.app package:
我们所要做的就是压缩 *.app 包:
pushd "/build"
mkdir ./Payload
cp -R "$PATH_TO_SIGNED_APP_PACKAGE.app" ./Payload
zip -qyr MyApp.ipa ./Payload
rm -r ./Payload
popd
Note:
笔记:
- Jump into the target directory, here
/build
. This ensures we don't have the full path in the zip archive later. - Create a folder named
Payload
(important, this cannot vary) - Copy the *.app bundle to the
Payload
folder - Zip the folder and instead of *.zip use *.ipa as extension
- Jump back to where you came from
- 跳转到目标目录,这里
/build
。这可确保我们稍后在 zip 存档中没有完整路径。 - 创建一个名为
Payload
(重要,这不能改变)的文件夹 - 将 *.app 包复制到
Payload
文件夹 - 压缩文件夹,而不是 *.zip 使用 *.ipa 作为扩展名
- 跳回你来的地方
回答by twj
Another workaround would be to put a copy of the PackageApplication
tool from a previous Xcode into the Xcode 8.3 directory
另一种解决方法是将PackageApplication
以前 Xcode中的工具副本放入 Xcode 8.3 目录中
Get the PackageApplication
script from Xcode 8.2.1 here: https://gist.github.com/anonymous/48f3e4c5ae25313dc0fe10d9ec50c3fc
PackageApplication
从 Xcode 8.2.1获取脚本:https: //gist.github.com/anonymous/48f3e4c5ae25313dc0fe10d9ec50c3fc
Remember to make it executable
记得让它可执行
chmod +x PackageApplication
Then drop it into your 8.3 Xcode.app as
然后把它放到你的 8.3 Xcode.app 中
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication
回答by Caffrey Sun
This is the error:
xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH
It looks like PackageApplication is removed from Xcode 8.3.
In Xcode 8.2 there was a warning: PackageApplication is deprecated, use xcodebuild -exportArchive
instead.
这是错误:xcrun:错误:无法找到实用程序“PackageApplication”,而不是开发人员工具或在 PATH 看起来 PackageApplication 已从 Xcode 8.3 中删除。在 Xcode 8.2 中有一个警告:PackageApplication is deprecated,xcodebuild -exportArchive
改用。