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
Count the simulator runtimes CoreSimulator keeps as cryptexes
Țugui Dragoș7186f7049077
diff --git a/Packages/PeelCore/Sources/PeelCore/Space/SpaceReport.swift b/Packages/PeelCore/Sources/PeelCore/Space/SpaceReport.swiftindex 071e69c7..b474ab28 100644--- a/Packages/PeelCore/Sources/PeelCore/Space/SpaceReport.swift+++ b/Packages/PeelCore/Sources/PeelCore/Space/SpaceReport.swift@@ -166,10 +166,15 @@ public enum SpaceInventory {public static var managedAreaIdentifiers: [String] { definitions.filter { $0.managedBy != nil }.map(\.id) }static let definitions: [Definition] = [+ // CoreSimulator's daemon, simdiskimaged, keeps runtime images in both stores its sandbox lets it write to, the+ // second for runtimes mounted as cryptexes. Their mounted volumes are elsewhere and would count twice.Definition(id: "simulators",category: .development,- paths: ["Library/Developer/CoreSimulator/Devices", "/Library/Developer/CoreSimulator/Images"],+ paths: [+ "Library/Developer/CoreSimulator/Devices", "/Library/Developer/CoreSimulator/Images",+ "/Library/Developer/CoreSimulator/Cryptex/Images",+ ],handling: .readOnly,commands: [Command("xcrun simctl runtime delete --outdated", needs: .simctlRuntimeOption("--outdated")),diff --git a/Packages/PeelCore/Tests/PeelCoreTests/SpaceInventoryTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/SpaceInventoryTests.swiftindex 02cd18cb..d0d1ecaf 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/SpaceInventoryTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/SpaceInventoryTests.swift@@ -258,6 +258,22 @@ struct SpaceInventoryTests {#expect(!paths.contains("Caches"), "the caches Developer selects are counted here as well")}+ @Test func countsTheRuntimesCoreSimulatorKeepsAsCryptexes() async throws {+ let directory = try TemporaryDirectory()+ try directory.file("root/Library/Developer/CoreSimulator/Cryptex/Images/bundle/runtime.dmg", bytes: 400_000)++ let report = await SpaceInventory.scan(+ home: directory.url.appending(path: "home", directoryHint: .isDirectory),+ root: directory.url.appending(path: "root", directoryHint: .isDirectory),+ minimumSize: 100_000,+ measure: LeftoverScanner.walk+ )++ let simulators = try #require(report.items.first { $0.id == "simulators" })+ #expect(simulators.urls.map { $0.path(percentEncoded: false) }.contains { $0.hasSuffix("Cryptex/Images/") })+ #expect(simulators.size.known >= 400_000)+ }+@Test func findsTheCachesAndLogsInEveryAppsContainer() async throws {let directory = try TemporaryDirectory()try directory.file("Library/Containers/org.example.chat/Data/Library/Caches/blob", bytes: 8_000)