`xcodes uninstall` doesn't unregister Xcode from LaunchServices
Open
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 uninstallto 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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