xcodes icon indicating copy to clipboard operation
xcodes copied to clipboard

Feature Request: Allow providing macOS password via environment variable for CI support

Open wei18 opened this issue 6 months ago • 0 comments

šŸ™ Request Summary

First of all, thank you for maintaining xcodes — it's an incredibly helpful tool for managing Xcode versions both locally and in CI environments.

I’m currently using xcodes in a self-hosted CI runner and ran into a limitation with the --select command, which requires superuser privileges. The current implementation prompts for a password interactively:

https://github.com/XcodesOrg/xcodes/blob/938adbc7d002744d508bd4e7a848a53dd94dc01e/Sources/XcodesKit/XcodeSelect.swift#L135-L141

✨ Feature Proposal

Would it be possible to enhance this behavior by optionally allowing the password to be provided via an environment variable — for example:

export XCODES_SUDO_PASSWORD=your_password

When this variable is set, xcodes could use its value instead of prompting interactively.

āœ… Benefits

This would be extremely useful in non-interactive environments such as:

  • GitHub Actions
  • Self-hosted CI runners
  • Local automation scripts It would allow full automation of xcodes install --select without manual intervention.

wei18 avatar Jul 01 '25 07:07 wei18