xcode Xcrun PackageApplication,无法复制应用程序失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8536728/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 22:45:55  来源:igfitidea点击:

Xcrun PackageApplication, failed unable to copy application

xcodecommand-linebuildterminal

提问by Ertai

I've created a simple application in Xcode. Setted up a provisioning for Debug and Release configuration. I'm performing in terminal:

我在 Xcode 中创建了一个简单的应用程序。为调试和发布配置设置了配置。我在终端执行:

xcodebuild -target signtest -configuration Debug -sdk iphoneos clean build

And it is building correctly. Now I'm trying to make an ipa file with this command:

它正在正确构建。现在我正在尝试使用以下命令制作一个 ipa 文件:

/usr/bin/xcrun -sdk iphoneos PackageApplication -v /Users/admin/Desktop/signtest/signtest/build/Debug-iphoneos/signtest.app/  -o /Users/admin/Desktop/binaries/signtest.ipa

And I'm getting this error:

我收到此错误:

Packaging application: '/Users/admin/Desktop/signtest/signtest/build/Debug-iphoneos/signtest.app/'
Arguments: verbose=1  output=/Users/admin/Desktop/binaries/signtest.ipa  
Environment variables:
HOME = /Users/admin
DISPLAY = /tmp/launch-vj2zx7/org.x:0
COMMAND_MODE = unix2003
VERSIONER_PERL_PREFER_32_BIT = no
SSH_AUTH_SOCK = /tmp/launch-YPyQMl/Listeners
Apple_PubSub_Socket_Render = /tmp/launch-mcFbgX/Render
CODESIGN_ALLOCATE = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
PWD = /Users/admin/Desktop/signtest/signtest
LANG = pl_PL.UTF-8
USER = admin
CLICOLOR = 1
LOGNAME = admin
__CF_USER_TEXT_ENCODING = 0x1F6:29:42
SHLVL = 1
TERM_PROGRAM = Apple_Terminal
OLDPWD = /Users/admin/Desktop/signtest/signtest/signtest
_ = /usr/bin/xcrun
TERM_PROGRAM_VERSION = 299
TERM_SESSION_ID = A74C6214-58A9-4CE6-9032-B902BD286253
PATH = /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
LSCOLORS = GxFxCxDxBxegedabagaced
SHELL = /bin/bash
TMPDIR = /var/folders/k2/28y_cf8d4b387lr2kf6vlsjr0000gp/T/
TERM = xterm-256color
VERSIONER_PERL_VERSION = 5.12

Output directory: '/Users/admin/Desktop/binaries/signtest.ipa'
Temporary Directory: '/var/folders/k2/28y_cf8d4b387lr2kf6vlsjr0000gp/T/hbdHfiqg31'  (will NOT be deleted on exit when verbose set)
+ /bin/cp -Rp /Users/admin/Desktop/signtest/signtest/build/Debug-iphoneos/signtest.app/ /var/folders/k2/28y_cf8d4b387lr2kf6vlsjr0000gp/T/hbdHfiqg31/Payload
Program /bin/cp returned 0 : []
error: Unable to copy application '/Users/admin/Desktop/signtest/signtest/build/Debug-iphoneos/signtest.app/' into '/var/folders/k2/28y_cf8d4b387lr2kf6vlsjr0000gp/T/hbdHfiqg31/Payload'

What is wrong here?

这里有什么问题?

回答by Barry Leslie

I got this error because of a trailing '/' on the app path:

由于应用程序路径上的尾随“/”,我收到此错误:

This fails:

这失败了:

xcrun -sdk iphoneos PackageApplication -v foobar.app/

This works:

这有效:

xcrun -sdk iphoneos PackageApplication -v foobar.app

回答by JoeCortopassi

Just out of curiosity, have you checked to make sure that you have proper permissions and that the source and destination directories exist? It looks like the copy command is failing. My guess is from a problem with the temp dir.

出于好奇,您是否检查过以确保您拥有适当的权限以及源目录和目标目录是否存在?看起来复制命令失败了。我的猜测是临时目录的问题。