Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Can't Run xcodebuild from project folder

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)

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.

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.

Edit

Project directory permissions set to 775.

I've also tried changing the ownership to the user Jenkins runs on.

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)
like image 824
cesarislaw Avatar asked Mar 20 '12 21:03

cesarislaw


1 Answers

Make sure that the user under which Jenkins runs has the right permissions. Go to http://[jenkins_server]/systemInfo and search for user.name.

like image 50
malenkiy_scot Avatar answered Nov 01 '22 07:11

malenkiy_scot