Last active
October 31, 2024 13:54
-
Star
(113)
You must be signed in to star a gist -
Fork
(29)
You must be signed in to fork a gist
-
-
Save rnapier/3370649 to your computer and use it in GitHub Desktop.
Links Xcode SDKs from the /SDKs directory (which you maintain yourself)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# fix-xcode | |
# Rob Napier <[email protected]> | |
# Script to link in all your old SDKs every time you upgrade Xcode | |
# Create a directory called /SDKs (or modify source_path). | |
# Under it, put all the platform directories: | |
# MacOSX.platform iPhoneOS.platform iPhoneSimulator.platform | |
# Under those, store the SDKs: | |
# MacOSX10.4u.sdk MacOSX10.5.sdk MacOSX10.6.sdk MacOSX10.7.sdk MacOSX10.8.sdk | |
# | |
# After upgrading Xcode, just run fix-xcode. | |
import argparse | |
import subprocess | |
import os | |
source_path = "/SDKs" | |
parser = argparse.ArgumentParser() | |
parser.add_argument('xcodePath', help='path to Xcode', nargs='?') | |
args = parser.parse_args() | |
if args.xcodePath: | |
dest_path = args.xcodePath | |
else: | |
dest_path = subprocess.check_output(["xcode-select", "--print-path"]).rstrip() | |
if not dest_path.endswith("/Contents/Developer"): | |
dest_path += "/Contents/Developer" | |
for platform in os.listdir(source_path): | |
subprocess.call("sudo ln -sf %(source_path)s/%(platform)s/* %(dest_path)s/Platforms/%(platform)s/Developer/SDKs" % locals(), shell=True) |
@rnapier You might want to change :
#!/usr/bin/python
to
#!/usr/bin/env python3
As there is no more python
integrated with the macOS.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This not work for xcode12