Jenkins无法从项目文件夹运行xcodebuild [英] Jenkins Can't Run xcodebuild from project folder
问题描述
我正在尝试为iOS应用程序设置CI环境。到目前为止,我已经得到了xcodebuild从命令行正确地构建测试版本,但当Jenkins尝试执行它,我得到以下在控制台中读出:
I'm attempting to set up a CI environment for an iOS application. So far I've gotten xcodebuild to build the test build correctly from the command line but when Jenkins tries to execute it I get the following read out in the console:
Started by user anonymous
Building in workspace /Users/Shared/Jenkins/Home/jobs/Unit Tests/workspace
Working directory is /Users/iosappdev/Documents/Xcode Projects/rules.
[rules] $ /usr/bin/xcodebuild -version
FATAL: Cannot run program "/usr/bin/xcodebuild" (in directory "/Users/iosappdev/Documents/Xcode Projects/rules"): error=13, Permission denied
java.io.IOException: Cannot run program "/usr/bin/xcodebuild" (in directory "/Users/iosappdev/Documents/Xcode Projects/rules"): error=13, Permission denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:707)
at hudson.Launcher$ProcStarter.start(Launcher.java:338)
at hudson.Launcher$ProcStarter.join(Launcher.java:345)
at au.com.rayh.XCodeBuilder.perform(XCodeBuilder.java:224)
有什么想法吗?我对Jenkins很新,但是我尽力用Google Fu回答这个问题没有用。我最初遇到这个问题,手动安装Jenkins(技术上的自制),但最近使用OSX安装程序,并导致相同的错误。
Any thoughts? I'm fairly new to Jenkins but I have done my best to answer this question with Google Fu to no avail. I did originally run into this problem with a manual installation of Jenkins (homebrew technically) but recently used the OSX installer and it resulted in the same error.
我猜这与Unix / Linux / OSX的权限比Jenkins / Xcode更多,但是没有足够的专业知识来确定。
I'm guessing this has more to do with Unix/Linux/OSX permissions than Jenkins/Xcode but don't have enough expertise to determine that for certain.
strong>
Edit
项目目录权限设置为775。
Project directory permissions set to 775.
这是我试图运行xcodebuild作为守护进程用户($ sudo -u守护进程xcodebuild)的输出:
Here's the output for when I attempted to run xcodebuild as the daemon user ($ sudo -u daemon xcodebuild):
dev-imac:rules iosappdev$ sudo -u daemon xcodebuild
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
2012-03-21 11:05:46.161 xcodebuild[1411:70b] [MT] DVTAssertions: ASSERTION FAILURE in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-1196/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/Xcode3Model/Xcode3Project.m:266
Details: Assertion failed: [directoryPath isAbsolutePath]
Object: <Xcode3Project>
Method: +projectFilesInDirectory:
Thread: <NSThread: 0x40010a260>{name = (null), num = 1}
Hints: None
Backtrace:
0 0x000000010025b85f -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in DVTFoundation)
1 0x000000010025b6b5 _DVTAssertionFailureHandler (in DVTFoundation)
2 0x00000001011559bc +[Xcode3Project projectFilesInDirectory:] (in DevToolsCore)
3 0x00000001008a424b -[Xcode3CommandLineBuildTool _resolveInputOptions] (in Xcode3Core)
4 0x00000001008aa097 -[Xcode3CommandLineBuildTool run] (in Xcode3Core)
5 0x00000001001d7db6 (in xcodebuild)
6 0x00000001001d7c2c (in xcodebuild)
推荐答案
确保Jenkins运行的用户具有正确的权限。转到 http:// [jenkins_server] / systemInfo
并搜索 user.name
。
Make sure that the user under which Jenkins runs has the right permissions. Go to http://[jenkins_server]/systemInfo
and search for user.name
.
这篇关于Jenkins无法从项目文件夹运行xcodebuild的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!