https://github.com/s2mr/xc
Open your xcode project with Xcode of specific version
https://github.com/s2mr/xc
Last synced: 16 days ago
JSON representation
Open your xcode project with Xcode of specific version
- Host: GitHub
- URL: https://github.com/s2mr/xc
- Owner: s2mr
- License: mit
- Created: 2023-01-05T15:17:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T05:42:49.000Z (11 months ago)
- Last Synced: 2025-03-06T10:09:10.366Z (about 1 month ago)
- Language: Swift
- Size: 44.9 KB
- Stars: 22
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-swift - xc - A tool to open the Xcode project file by the specified version. (Misc / Vim)
- awesome-swift - xc - A tool to open the Xcode project file by the specified version. (Misc / Vim)
README
# xc
Open the Xcode project file with the specified version## Usage
Open project file with preferred Xcode version:
```
xc
```Open project file with Xcode 14.2.0:
```
xc -v 14.2.0
``````
xc list---
Available Xcode:
14.2 /Applications/Xcode.app
14.1 /Applications/Xcode14.1.app
13.4.1 /Applications/Xcode13.4.1.app
13.2.1 /Applications/Xcode13.2.1.app
```## Feature
### Automatic project file searching (priority)
1. User specified path
2. `.xcworkspace`
3. `.xcodeproj`
4. `Package.swift`### Automatic Xcode version searching (priority)
1. User specified version
2. `.xcode-version`
3. `$ xcode-select`### Show all Xcode list you installed
Automatically searching xcode via `NSWorkspace.shared.urlsForApplications(withBundleIdentifier: "com.apple.dt.Xcode")`.
```
xc list---
Available Xcode:
14.2 /Applications/Xcode.app
14.1 /Applications/Xcode14.1.app
13.4.1 /Applications/Xcode13.4.1.app
13.2.1 /Applications/Xcode13.2.1.app
```### Open Xcode.app without opening project
Simply run:
```
xc -n
```### Automatically changing developer directory via xcode-select
When you execute `xc` or `xc open` command, automatically execute `sudo xcode-select --switch`.
This needs sudo password.
You can setting sudo password via `$ xc config`> **Warning**
>
> This feature is disabled by default.
>
> You can enabled this feature by executing command below.
>
> `$ xc config write --sudo-password --auto-xcode-select-enabled true`### Command completion
This command is built on [swift-argument-parser](https://github.com/apple/swift-argument-parser).
Please refer to [this article](https://github.com/apple/swift-argument-parser/blob/main/Sources/ArgumentParser/Documentation.docc/Articles/InstallingCompletionScripts.md#installing-zsh-completions
).Replace `example` with `xc`.
## Installation
### [Homebrew](https://brew.sh/)
```shell
brew install s2mr/tap/xc
```### [Swift Package Manager](https://github.com/apple/swift-package-manager)
Add the following to the dependencies of your `Package.swift`:
```swift
dependencies: [
.package(url: "https://github.com/s2mr/xc.git", from: "xc version"),
]
```Run command:
```sh
swift run -c release xc [COMMAND] [OPTIONS]
```### [Mint](https://github.com/yonaskolb/Mint)
Install with Mint by following command:
```sh
mint install s2mr/xc
```Run command:
```sh
mint run s2mr/xc [COMMAND] [OPTIONS]
```### Using a pre-built binary
You can also install xc by downloading `xc.zip` from the latest GitHub release.
## Help
```
xc --help---
OVERVIEW: This tool launches the Xcode application and opens the given documents.USAGE: xc
OPTIONS:
--version Show the version.
-h, --help Show help information.SUBCOMMANDS:
list Available Xcodes list
open (default) Shows available versions of Xcode
config Read and write xc command config. Config json is stored at `~/.config/xc/config.json`
env Current environmentSee 'xc help ' for detailed help.
``````
xc open --help---
OVERVIEW: Shows available versions of XcodeUSAGE: xc open [-v ] []
ARGUMENTS:
File pathOPTIONS:
-v Open with specific Xcode version
--version Show the version.
-h, --help Show help information.
```