Skip to content

Instantly share code, notes, and snippets.

@omarzl
Last active May 5, 2022 22:53
Show Gist options
  • Save omarzl/3dd13e82fe318271a377fab664ae955b to your computer and use it in GitHub Desktop.
Save omarzl/3dd13e82fe318271a377fab664ae955b to your computer and use it in GitHub Desktop.
- Pluginfile
gem 'xcode-install'
- Fastfile
platform :ios do
desc "Xcode install"
lane :install_xcode do
xcode_install(
version: "#{ENV['XCODE_VERSION']}",
username: "some@apple.id"
)
end
end
- install_xcode.sh
export FASTLANE_SESSION="a_valid_session"
export XCODE_VERSION="13.3.1"
# Installs Xcode
bundle exec fastlane install_xcode
# Changes CLT to new Xcode
sudo xcode-select -s /Applications/Xcode-$XCODE_VERSION.app
# Validates Xcode version
/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" /Applications/Xcode-$XCODE_VERSION.app/Contents/Info.plist
# Validates CLT path
xcode-select -p
# Validates swift version
swift --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment