Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Of Xcode's previews, only the simulator devices it makes are offered
Țugui Dragoș61de5c40cc32
diff --git a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swiftindex 96b6835a..88dfdc29 100644--- a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift+++ b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift@@ -107,7 +107,7 @@ public enum DeveloperCaches {// AppleDefinition(id: "xcode", name: "Xcode", systemImage: "hammer", appBundleIdentifiers: ["com.apple.dt.Xcode", "com.apple.iphonesimulator"], folders: [Folder("Library/Developer/Xcode/DerivedData", .buildData),- Folder("Library/Developer/Xcode/UserData/Previews", .buildData),+ Folder("Library/Developer/Xcode/UserData/Previews/Simulator Devices", .buildData),Folder("Library/Developer/Xcode/iOS DeviceSupport", .deviceSupport),Folder("Library/Developer/Xcode/watchOS DeviceSupport", .deviceSupport),Folder("Library/Developer/Xcode/tvOS DeviceSupport", .deviceSupport),diff --git a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swiftindex 2af9fd1d..54467977 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift@@ -293,6 +293,19 @@ struct DeveloperCachesTests {#expect(suggested == ["pnpm"], "a store installed packages link into was suggested")}+ /// Of what Xcode keeps for previews, only the simulator devices it makes for them are offered: Xcode itself lists+ /// that folder among the simulator device sets it removes.+ @Test func offersOnlyTheSimulatorDevicesXcodeMakesForPreviews() async throws {+ let directory = try TemporaryDirectory()+ try directory.file("Library/Developer/Xcode/UserData/Previews/Simulator Devices/device_set.plist", bytes: 400_000)+ try directory.file("Library/Developer/Xcode/UserData/Previews/other/state", bytes: 400_000)+ let xcode = DeveloperCaches.definitions.filter { $0.id == "xcode" }++ let offered = await DeveloperCaches.scan(xcode, homeDirectory: directory.url).flatMap(\.locations).map(\.url.lastPathComponent)++ #expect(offered == ["Simulator Devices"])+ }+/// virtualenvwrapper keeps the user's hook scripts beside the environments in `~/.virtualenvs`, so only the/// environments are offered, and a link among them is left where it is, never followed.@Test func offersVirtualenvwrappersEnvironmentsAndNotItsHooks() async throws {