0

I'm using TeamCity 8.0.5 hosted on a Mac, and I have a second Mac setup as my build agent with both Xcode 3.2.6 and Xcode 4.6.2 installed. The projects that I am using require specific IDE versions, no thanks to Adobe SDK, and I can't seem to setup TeamCity to specify which version of Xcode to use for the build.

If I use the xcode-select command, I can manually set the build to either version of Xcode before I start the build and both go through without a hitch.

I attempted to add a new build step with a 'Command Line' Runner type with the following command:

xcode-select -switch /Developer/Xcode3/

However the xcode-select command needs to be run as a sudoer. When I added a sudo prefix on the line, I got the following error:

 Step 1/3: Switch xcodeBuild to Xcode3 (Command Line)
[Step 1/3] Starting: /Applications/TeamCity/buildAgent/temp/agentTmp/custom_script12345
[Step 1/3] in directory: /Applications/TeamCity/buildAgent/work/12345
[Step 1/3] Sorry, try again.
[Step 1/3] Sorry, try again.
[Step 1/3] Sorry, try again.
[Step 1/3] sudo: 3 incorrect password attempts
[Step 1/3] Process exited with code 1

I attempted the fix by writing the command to a bash script, placing the script at a local file path, and opening up execute permissions. This got me a little farther:

 Step 1/3: Switch xcodeBuild to Xcode3 (Command Line)
[Step 1/3] Starting: /xcode.sh
[Step 1/3] in directory: /Applications/TeamCity/buildAgent/work/12345
[Step 1/3] sudo: no tty present and no askpass program specified

I was able to find this post on StackOverflow on how to fix the tty problem, but I was only able to call the script a few times before being prompted for a password from the script again. I'm not sure if being logged into the computer locally or via SSH keeps the script working, or if modifying the /etc/sudoers file has the same effect on a Mac as it does on a Linux distro.

I think I'm looking for a better way to either run a sudo command from a Command Line or select another version of Xcode from TeamCity.

Thanks for reading this long post!

Braiam
  • 1
  • 11
  • 47
  • 78
Matt Plank
  • 333
  • 6
  • 12
  • 1
    FYI - starting on February 1st, all new iOS apps and iOS app updates must use Xcode 5 as well as fully support iOS 7. There's no point in supporting or using Xcode 3 or Xcode 4 at this point. – rmaddy Jan 24 '14 at 21:59
  • I appreciate the comment, but I'm using the InDesign SDK where CS6.0 only builds with Xcode 3.2.x and CC only builds with Xcode 4.x with its dependencies. – Matt Plank Jan 24 '14 at 22:05
  • 1
    My point was that in one week Apple will no longer accept your apps built with those tools. If your apps are only for in-house use then that won't be a problem. – rmaddy Jan 24 '14 at 22:06

0 Answers0