Q: Cannot start Xcode service due to license agreement
Since upgrading to Server 5.0.15, I encountered a couple issues attempting to start the Xcode service, the latter of which is preventing proper startup:
When I attempted to select Xcode by clicking Choose Xcode in the server window, after I chose /Applications/Xcode, I saw the message "Preparing to configure Xcode server", and Xcode was launched. Then Xcode displayed a message stating "Xcode requires permission to use the Accessibility for UI Testing. Click Request Access to open System Preferences add Xcode to the list of applications allowed to control your computer." When I clicked Request Access, nothing significant happened. I opened System Preferences > Accessibility manually, but was unsure where to add Xcode to the list. I saw no lists under Interacting > Keyboard, Mouse & Trackpad, or Switch Control. None of the other sections seemed to contain an application list either. After some digging around I noticed that there is an entry in System Preferences > Security & Privacy > Privacy for Xcode Helper that was unchecked. Checking that box seems to have accomplished the goal here (fingers crossed).
Server then displayed the message "You must agree to the terms of the Xcode license agreement. Launch Xcode again and agree to the software license agreement, or choose a different version of Xcode". When I launched Xcode, however, it did not display the license agreement. Issuing the sudo xcodebuild -license and sudo xcodebuild -license accept commands in a terminal window did not seem to get this done in the right way because Server continues to display that message each time I choose the Xcode application.
There must be a reason Xcode does not display the license agreement when I launch it, yet Server insists I have not accepted the agreement despite having accepted it several times.
Any ideas?
Mac Pro, OS X Yosemite (10.10.5)
Posted on Mar 18, 2016 11:27 PM
Potentially a known bug, depending on the versions involved. (Search for license in the Xcode release notes.)
If the approach in the release notes doesn't work and if this existing discussion doesn't work...
...then see if the brute-force approach works...
Disable Xcode services from Server.app. Delete Xcode from the system. Reboot. Reinstall Xcode from a fresh (current) download or from a (current) version stored on another local system, launch Xcode, accept the license. Then configure Server.app, and see if it's happy now.
Posted on Mar 19, 2016 8:05 AM