https://github.com/vincentcatillon/xcoderc
:pencil2::hammer: Used to lock, check and use Xcode version in your project.
https://github.com/vincentcatillon/xcoderc
check lock use version xcode xcode-select xcodebuild xcoderc
Last synced: 4 months ago
JSON representation
:pencil2::hammer: Used to lock, check and use Xcode version in your project.
- Host: GitHub
- URL: https://github.com/vincentcatillon/xcoderc
- Owner: VincentCATILLON
- Created: 2019-04-19T16:20:30.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T23:50:11.000Z (about 3 years ago)
- Last Synced: 2025-10-10T13:27:48.232Z (4 months ago)
- Topics: check, lock, use, version, xcode, xcode-select, xcodebuild, xcoderc
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/xcoderc
- Size: 3.82 MB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Switching between iOS/MacOS projects
that use different Xcode versions won't by painful anymore.
[](https://circleci.com/gh/VincentCATILLON/xcoderc)
[](https://codecov.io/gh/VincentCATILLON/xcoderc)
[](https://flow.org)
[](https://eslint.org/)
[](https://www.npmjs.com/package/xcoderc)
## Installation
```console
npm install --save-dev xcoderc
# or
yarn add --dev xcoderc
```
## Init
You need a `.xcoderc` file on your project root to lock the Xcode version.
```console
$ npx xcoderc init
```
For your information, the file content should look like: `9.4`
_**Note**: This will create a .xcoderc file with your current Xcode version_
## Usage

---
##### Check
To automatize the Xcode version check, you can use it in your `package.json`, ie:
```json
{
"postinstall": "xcoderc"
}
```
or you can add it before your iOS build command, ie:
```json
{
"prebuild:ios": "xcoderc",
"build:ios": "xcodebuild"
}
```
or any script used to build your app, for example [Fastlane](https://fastlane.tools) (with [fastlane-plugin-yarn](https://github.com/joshrlesch/fastlane-plugin-yarn) plugin):
```ruby
platform :ios do
before_all do
# Define a command in your package.json like:
# {
# "xcode:check": "xcoderc"
# }
yarn(command: 'xcode:check', package_path: '../package.json')
end
end
```
---
##### Use
To use the version specified in your `.xcoderc` file:
```console
$ [sudo] npx xcoderc use
```
_**Note**: This commands needs to be root._
## Example versions (not exhaustive)
- 9
- 9.0.1
- 9.1
- 9.2
- 9.3
- 9.3.1
- 9.4
- 9.4.1
- 10
- 10.1
- 10.2
- 10.2.1