Skip to content

Instantly share code, notes, and snippets.

@Skyxim
Forked from Kyle-Ye/XcodeLLM.md
Created June 17, 2024 00:35
Show Gist options
  • Save Skyxim/63c27333eb11c7b14cc13e362917b885 to your computer and use it in GitHub Desktop.
Save Skyxim/63c27333eb11c7b14cc13e362917b885 to your computer and use it in GitHub Desktop.
Enable XcodeLLM for ChinaSKU Mac on macOS 15 Beta 1

Warning

The following guide need to disable SIP to work.

Please confirm the risk of disabling the SIP by yourself.

Another solution which does not require disabling SIP is currently under investigation.

Step 0

Reboot into Recovery OS + Disable SIP

csrutil disable

Step 1

# Remove IDEModelAccessOnDeviceAvailabilityOverride if you have watched my tweet before
defaults delete com.apple.dt.Xcode IDEModelAccessOnDeviceAvailabilityOverride
# Clear old eligibilityd cache
sudo rm -rf /private/var/db/eligibilityd
# Lauch Xcode to tirgger a new record
/Applications/Xcode-16.0.0-Beta.app/Contents/MacOS/Xcode

Use vim in terminal or VSCode to change eligibility.plist (Need root permission)

sudo vim /private/var/db/os_eligibility/eligibility.plist
# Go to OS_ELIGIBILITY_DOMAIN_XCODE_LLM field
# The normal value are 1, 2, 3, 2
# You need to change them to 1, 4, 3, 3 

For the meaning of the numbers, you can check out https://x.com/KyleSwifter/status/1802405373133099475 or eligibilityd repo which I will open source later.

Step 2

Lock the eligibility.plist file to prevent eligibilityd changing it again.

  1. cd /private/var/db/eligibilityd && open .
  2. ⌘+I on eligibility.plist file
  3. In Sharing & Permissions section, unlock and then set system's privilege to "Read only" too.

Step 3

Reboot and open Xcode. That's all. Done.

Click the "Predictive code completion" on Xcode and then it will tirgger a popup to download the LLM model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment