Skip to content

Conversation

@interstateone
Copy link
Contributor

This changes the installation behaviour to move XIPs to the Trash after Xcode has been installed to /Applications instead of immediately deleting them. This more closely matches the steps users take when downloading Xcode XIPs manually, but more importantly it provides a way to recover from installation issues without downloading the (very large) XIPs all over again.

$ .build/release/xcodes install 11 beta 4
Downloading Xcode 11.0.0-beta.4+11M374r: 195%
Xcode archive Xcode-11.0.0-beta.4+11M374r.xip has been moved to the Trash.
Xcode 11.0.0-beta.4+11M374r failed its security assessment with the following output:

/Applications/Xcode-11.0.0-beta.4.app: rejected (invalid destination for symbolic link in bundle)

It remains installed at /Applications/Xcode-11.0.0-beta.4.app if you wish to use it anyways.

Closes #56

@interstateone interstateone force-pushed the 56-trash-instead-of-remove branch from c0c0393 to c1c9f0e Compare July 20, 2019 21:11
This allows user intervention if installation fails without requiring them to re-download the XIP, and doesn't add any* steps to the happy path.

Resolves XcodesOrg#56.
@interstateone interstateone force-pushed the 56-trash-instead-of-remove branch from c1c9f0e to ad9b620 Compare July 20, 2019 21:22
@MattKiazyk MattKiazyk self-assigned this Jul 29, 2019
@MattKiazyk MattKiazyk self-requested a review July 29, 2019 23:27
Copy link
Contributor

@MattKiazyk MattKiazyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well and seemed to remove from trash 👍

Downloading Xcode 11.0.0-beta.5+11M382q: 100%
Xcode archive Xcode-11.0.0-beta.5+11M382q.xip has been moved to the Trash.

Screenshot 2019-07-29 16 28 22

@interstateone interstateone merged commit 66188b6 into XcodesOrg:master Jul 30, 2019
@interstateone interstateone deleted the 56-trash-instead-of-remove branch July 30, 2019 00:53
juanjonol added a commit to juanjonol/xcodes that referenced this pull request Sep 10, 2022
After Pull Request XcodesOrg#60, `xcodes` always moves Xcode's .xip to the Trash after installation. This is problematic for scripts, because on modern macOS versions, [Full Disk Access is required to programatically delete the Trash](https://apple.stackexchange.com/questions/376916/cannot-ls-trash-in-the-terminal-in-catalina-operation-not-permitted).

To solve this without reducing security, added a new `--delete-xip` flag that automatically deletes the .xip after a successful installation.

- This is done this way to preserve the current behaviour (moving the .xip to the Trash) by default, [as it was originally intended](XcodesOrg#56 (comment)).

This closes XcodesOrg#185.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow .xip to be persisted after install

2 participants