Skip to content

Instantly share code, notes, and snippets.

@trinitronx
Last active January 18, 2024 05:20
Show Gist options
  • Select an option

  • Save trinitronx/6217746 to your computer and use it in GitHub Desktop.

Select an option

Save trinitronx/6217746 to your computer and use it in GitHub Desktop.

Revisions

  1. trinitronx revised this gist Dec 10, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions xcode-cli-tools.sh
    100644 → 100755
    Original file line number Diff line number Diff line change
    @@ -25,6 +25,8 @@ if [ ! -f "$TOOLS" ]; then
    DMGURL=http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_OS_X_10.11_for_Xcode_7.3.1/Command_Line_Tools_OS_X_10.11_for_Xcode_7.3.1.dmg
    elif [ "$OSX_VERS" -eq 12 ]; then
    DMGURL=http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_macOS_10.12_for_Xcode_8.1/Command_Line_Tools_macOS_10.12_for_Xcode_8.1.dmg
    elif [ "$OSX_VERS" -eq 14 ]; then
    DMGURL=https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_11_GM_Seed/Command_Line_Tools_for_Xcode_11_GM_Seed.dmg
    fi
    curl "$DMGURL" -o "$TOOLS"
    fi
  2. trinitronx revised this gist Dec 10, 2021. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions xcode-cli-tools.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,11 @@
    #!/bin/sh
    # 2021-12-09:
    # This script is no longer supported!
    # Apple broke all direct downloads without logging with an Apple ID first.
    # The number of hoops that a script would need to jump through to login,
    # store cookies, and download is prohibitive.
    # Now we all must manually download and mirror the files for this to work at all :'-(

    OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}')

    # Get Xcode CLI tools
  3. trinitronx revised this gist Sep 16, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions xcode-cli-tools.sh
    Original file line number Diff line number Diff line change
    @@ -18,6 +18,8 @@ if [ ! -f "$TOOLS" ]; then
    DMGURL=http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_OS_X_10.11_for_Xcode_7.3.1/Command_Line_Tools_OS_X_10.11_for_Xcode_7.3.1.dmg
    elif [ "$OSX_VERS" -eq 12 ]; then
    DMGURL=http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_macOS_10.12_for_Xcode_8.1/Command_Line_Tools_macOS_10.12_for_Xcode_8.1.dmg
    elif [ "$OSX_VERS" -eq 14 ]; then
    DMGURL=https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_11_GM_Seed/Command_Line_Tools_for_Xcode_11_GM_Seed.dmg
    fi
    curl "$DMGURL" -o "$TOOLS"
    fi
  4. trinitronx revised this gist Sep 16, 2019. 1 changed file with 0 additions and 0 deletions.
    Empty file modified xcode-cli-tools.sh
    100644 → 100755
    Empty file.
  5. trinitronx revised this gist Dec 10, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion xcode-cli-tools.sh
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,7 @@ OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}')

    # Get Xcode CLI tools
    # https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/index-3905972D-B609-49CE-8D06-51ADC78E07BC.dvtdownloadableindex
    # https://developer.apple.com/downloads/index.action
    TOOLS=clitools.dmg
    if [ ! -f "$TOOLS" ]; then
    if [ "$OSX_VERS" -eq 7 ]; then
    @@ -16,7 +17,7 @@ if [ ! -f "$TOOLS" ]; then
    elif [ "$OSX_VERS" -eq 11 ]; then
    DMGURL=http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_OS_X_10.11_for_Xcode_7.3.1/Command_Line_Tools_OS_X_10.11_for_Xcode_7.3.1.dmg
    elif [ "$OSX_VERS" -eq 12 ]; then
    DMGURL=http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_macOS_10.12_for_Xcode_8/Command_Line_Tools_macOS_10.12_for_Xcode_8.dmg
    DMGURL=http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_macOS_10.12_for_Xcode_8.1/Command_Line_Tools_macOS_10.12_for_Xcode_8.1.dmg
    fi
    curl "$DMGURL" -o "$TOOLS"
    fi
  6. trinitronx revised this gist Sep 14, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xcode-cli-tools.sh
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ if [ ! -f "$TOOLS" ]; then
    fi
    TMPMOUNT=`/usr/bin/mktemp -d /tmp/clitools.XXXX`
    hdiutil attach "$TOOLS" -mountpoint "$TMPMOUNT"
    installer -pkg "$(find $TMPMOUNT -name '*.mpkg')" -target /
    installer -pkg "$(find $TMPMOUNT -name '*.mpkg' -o -name '*.pkg')" -target /
    hdiutil detach "$TMPMOUNT"
    rm -rf "$TMPMOUNT"
    rm "$TOOLS"
  7. trinitronx revised this gist Sep 14, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions xcode-cli-tools.sh
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,10 @@ if [ ! -f "$TOOLS" ]; then
    DMGURL=http://adcdownload.apple.com/Developer_Tools/command_line_tools_os_x_mavericks_for_xcode__late_october_2013/command_line_tools_os_x_mavericks_for_xcode__late_october_2013.dmg
    elif [ "$OSX_VERS" -eq 10 ]; then
    DMGURL=http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_OS_X_10.10_for_Xcode_6.3.2/commandlinetoolsosx10.10forxcode6.3.2.dmg
    elif [ "$OSX_VERS" -eq 11 ]; then
    DMGURL=http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_OS_X_10.11_for_Xcode_7.3.1/Command_Line_Tools_OS_X_10.11_for_Xcode_7.3.1.dmg
    elif [ "$OSX_VERS" -eq 12 ]; then
    DMGURL=http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_macOS_10.12_for_Xcode_8/Command_Line_Tools_macOS_10.12_for_Xcode_8.dmg
    fi
    curl "$DMGURL" -o "$TOOLS"
    fi
  8. trinitronx revised this gist Jun 6, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions xcode-cli-tools.sh
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,8 @@ if [ ! -f "$TOOLS" ]; then
    DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_mountain_lion_april_2013.dmg
    elif [ "$OSX_VERS" -eq 9 ]; then
    DMGURL=http://adcdownload.apple.com/Developer_Tools/command_line_tools_os_x_mavericks_for_xcode__late_october_2013/command_line_tools_os_x_mavericks_for_xcode__late_october_2013.dmg
    elif [ "$OSX_VERS" -eq 10 ]; then
    DMGURL=http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_OS_X_10.10_for_Xcode_6.3.2/commandlinetoolsosx10.10forxcode6.3.2.dmg
    fi
    curl "$DMGURL" -o "$TOOLS"
    fi
  9. trinitronx revised this gist Oct 26, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions xcode-cli-tools.sh
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,8 @@ if [ ! -f "$TOOLS" ]; then
    DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg
    elif [ "$OSX_VERS" -eq 8 ]; then
    DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_mountain_lion_april_2013.dmg
    elif [ "$OSX_VERS" -eq 9 ]; then
    DMGURL=http://adcdownload.apple.com/Developer_Tools/command_line_tools_os_x_mavericks_for_xcode__late_october_2013/command_line_tools_os_x_mavericks_for_xcode__late_october_2013.dmg
    fi
    curl "$DMGURL" -o "$TOOLS"
    fi
  10. trinitronx revised this gist Oct 26, 2013. 1 changed file with 7 additions and 5 deletions.
    12 changes: 7 additions & 5 deletions xcode-cli-tools.sh
    Original file line number Diff line number Diff line change
    @@ -4,12 +4,14 @@ OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}')
    # Get Xcode CLI tools
    # https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/index-3905972D-B609-49CE-8D06-51ADC78E07BC.dvtdownloadableindex
    TOOLS=clitools.dmg
    if [ "$OSX_VERS" -eq 7 ]; then
    DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg
    elif [ "$OSX_VERS" -eq 8 ]; then
    DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_mountain_lion_april_2013.dmg
    if [ ! -f "$TOOLS" ]; then
    if [ "$OSX_VERS" -eq 7 ]; then
    DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg
    elif [ "$OSX_VERS" -eq 8 ]; then
    DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_mountain_lion_april_2013.dmg
    fi
    curl "$DMGURL" -o "$TOOLS"
    fi
    curl "$DMGURL" -o "$TOOLS"
    TMPMOUNT=`/usr/bin/mktemp -d /tmp/clitools.XXXX`
    hdiutil attach "$TOOLS" -mountpoint "$TMPMOUNT"
    installer -pkg "$(find $TMPMOUNT -name '*.mpkg')" -target /
  11. trinitronx created this gist Aug 13, 2013.
    19 changes: 19 additions & 0 deletions xcode-cli-tools.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/bin/sh
    OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}')

    # Get Xcode CLI tools
    # https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/index-3905972D-B609-49CE-8D06-51ADC78E07BC.dvtdownloadableindex
    TOOLS=clitools.dmg
    if [ "$OSX_VERS" -eq 7 ]; then
    DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg
    elif [ "$OSX_VERS" -eq 8 ]; then
    DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_mountain_lion_april_2013.dmg
    fi
    curl "$DMGURL" -o "$TOOLS"
    TMPMOUNT=`/usr/bin/mktemp -d /tmp/clitools.XXXX`
    hdiutil attach "$TOOLS" -mountpoint "$TMPMOUNT"
    installer -pkg "$(find $TMPMOUNT -name '*.mpkg')" -target /
    hdiutil detach "$TMPMOUNT"
    rm -rf "$TMPMOUNT"
    rm "$TOOLS"
    exit