小编典典

Jenkins无法从项目文件夹运行xcodebuild

jenkins

我正在尝试为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)

阅读 450

收藏
2020-07-25

共1个答案

小编典典

确保运行Jenkins的用户具有正确的权限。转到http://[jenkins_server]/systemInfo并搜索user.name

2020-07-25