我正在尝试为iOS应用程序设置CI环境.到目前为止,我已经获得了
xcodebuild来从命令行正确构建测试版本,但是当Jenkins尝试执行它时,我在控制台中读取了以下内容:
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安装程序并导致了同样的错误.
我猜这与Unix / Linux / OSX权限有关,而不是Jenkins / Xcode,但没有足够的专业知识来确定.
编辑
项目目录权限设置为775.
我也尝试将所有权更改为Jenkins运行的用户.
这是我尝试将xcodebuild作为守护程序用户运行时的输出($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)