Giter Site home page Giter Site logo

extract-xcode-toolchain's Introduction

Extract Xcode toolchain

a shell script for extract Xcode toolchain from xip file.

Useage

Download Xcode xip file from: https://developer.apple.com/download/all/

./extract-xcode-toolchain.sh Xcode_11.3.1.xip ~/Documents

Xcode 11.3.1 toolchain will saved at ~/Documents/Xcode_11.3.1.xctoolchain.tar.xz

Install toolchain into installed Xcode.app

if your Xcode.app installed at /Applications/Xcode.app, create a directory with .xctoolchain suffix:

mkdir /Applications/Xcode.app/Contents/Developer/Toolchains/Xcode_11.3.1.xctoolchain

extract toolchain:

tar -xvf Xcode_11.3.1.xctoolchain.tar.xz \
    -C /Applications/Xcode.app/Contents/Developer/Toolchains/Xcode_11.3.1.xctoolchain

Using Xcode_11.3.1 toolchain in command line:

$ xcrun --toolchain Xcode_11.3.1 swift --version

Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
Target: x86_64-apple-darwin21.6.0

Install toolchain into macOS

User defined toolchain is installed at /Library/Developer/Toolchains

sudo mkdir -p /Library/Developer/Toolchains/Xcode_11.3.1.xctoolchain

extract toolchain into /Library/Developer/Toolchains/Xcode_11.3.1.xctoolchain

sudo tar -xvf Xcode_11.3.1.xctoolchain.tar.xz \
         -C /Library/Developer/Toolchains/Xcode_11.3.1.xctoolchain

User defined Identifier of toolchain can't have prefix com.apple.*, replace com.apple.dt.toolchain.Xcode_11.3.1 with Xcode_11.3.1:

/usr/libexec/PlistBuddy -c "Set Identifier Xcode_11.3.1" ToolchainInfo.plist

User defined CompatibilityVersion of toolchain should be 2:

/usr/libexec/PlistBuddy -c "Add CompatibilityVersion integer 2" ToolchainInfo.plist

Now, content of ToolchainInfo.plist:

$ /usr/libexec/PlistBuddy -c "Print" ToolchainInfo.plist

Dict {
    CompatibilityVersion = 2
    Identifier = Xcode_11.3.1
}

extract-xcode-toolchain's People

Contributors

cntrump avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.