XcodesOrg / XcodesOrg/xcodes

`xcodes uninstall` doesn't unregister Xcode from LaunchServices

Open
#234 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
4.8k
Forks
182
Avg merge
2d 12h
Merged PRs (30d)
1

Description

When xcodes uninstall is used to delete a Xcode version, this Xcode version isn't unregistered from LaunchServices, so this old version remains on the LaunchServices database indefinitely.

  • This can be checked with this command: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep <XCODE_FOLDER>
  • More info about the unregistering apps from LaunchServices here.

Possible solutions:

  • Find a replacement for removeItem(atPath:) that also updates the LaunchServices database.
  • Add a new phase to xcodes uninstall to unregister the uninstalled Xcode version (/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f -u <XCODE_PATH>, although this command doesn't seem to work for the apps inside Xcode).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the implementation of xcodes uninstall and inspect where removeItem(atPath:) deletes the Xcode version. Reproduce the issue with the provided lsregister -dump | grep <XCODE_FOLDER> command, then verify that uninstalling no longer leaves the removed version in the LaunchServices database.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, swift
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.