Skip to content

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

@wei18

Description

@wei18

πŸ™ 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:

let passwordInput = {
Promise<String> { seal in
Current.logging.log("xcodes requires superuser privileges to select an Xcode")
guard let password = Current.shell.readSecureLine(prompt: "macOS User Password: ") else { seal.reject(XcodeInstaller.Error.missingSudoerPassword); return }
seal.fulfill(password + "\n")
}
}

✨ 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions