Skip to content

Instantly share code, notes, and snippets.

@0x1306a94
Forked from Kyle-Ye/XcodeLLM.md
Created July 1, 2024 02:02
Show Gist options
  • Save 0x1306a94/38f2b4f473e74fc5a2727686dd512c4d to your computer and use it in GitHub Desktop.
Save 0x1306a94/38f2b4f473e74fc5a2727686dd512c4d 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.

Acknowlegement

If this is not work for you, you can also give a look at unixzii's solution

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