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
Installers and Backups says when macOS kept it out of a folder
Țugui Dragoșe308ce505da4
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstringsindex 6ed1bc2d..ed17b043 100644--- a/Localization/Peel/Localizable.xcstrings+++ b/Localization/Peel/Localizable.xcstrings@@ -64781,6 +64781,346 @@}}},+ "No installers were found, but Peel couldn’t look in ^[%lld folder](inflect: true), so there may be some there. Give Peel Full Disk Access to look there too." : {+ "localizations" : {+ "cs" : {+ "variations" : {+ "plural" : {+ "few" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nenašly se žádné instalátory, ale Peel nemohl nahlédnout do %lld složek, takže tam nějaké být mohou. Udělte Peelu plný přístup k disku, aby se mohl podívat i tam."+ }+ },+ "many" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nenašly se žádné instalátory, ale Peel nemohl nahlédnout do %lld složky, takže tam nějaké být mohou. Udělte Peelu plný přístup k disku, aby se mohl podívat i tam."+ }+ },+ "one" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nenašly se žádné instalátory, ale Peel nemohl nahlédnout do %lld složky, takže tam nějaké být mohou. Udělte Peelu plný přístup k disku, aby se mohl podívat i tam."+ }+ },+ "other" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nenašly se žádné instalátory, ale Peel nemohl nahlédnout do %lld složek, takže tam nějaké být mohou. Udělte Peelu plný přístup k disku, aby se mohl podívat i tam."+ }+ }+ }+ }+ },+ "de" : {+ "variations" : {+ "plural" : {+ "one" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Es wurden keine Installer gefunden, aber Peel konnte in %lld Ordner nicht hineinsehen, daher könnte es dort welche geben. Gib Peel Festplattenvollzugriff, damit Peel auch dort nachsehen kann."+ }+ },+ "other" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Es wurden keine Installer gefunden, aber Peel konnte in %lld Ordner nicht hineinsehen, daher könnte es dort welche geben. Gib Peel Festplattenvollzugriff, damit Peel auch dort nachsehen kann."+ }+ }+ }+ }+ },+ "es" : {+ "variations" : {+ "plural" : {+ "many" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "No se han encontrado instaladores, pero Peel no ha podido mirar en %lld de carpetas, así que podría haber alguno ahí. Da a Peel acceso total al disco para que también mire ahí."+ }+ },+ "one" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "No se han encontrado instaladores, pero Peel no ha podido mirar en %lld carpeta, así que podría haber alguno ahí. Da a Peel acceso total al disco para que también mire ahí."+ }+ },+ "other" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "No se han encontrado instaladores, pero Peel no ha podido mirar en %lld carpetas, así que podría haber alguno ahí. Da a Peel acceso total al disco para que también mire ahí."+ }+ }+ }+ }+ },+ "fr" : {+ "variations" : {+ "plural" : {+ "many" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Aucun programme d’installation n’a été trouvé, mais Peel n’a pas pu regarder dans %lld de dossiers, qui peuvent donc en contenir. Accordez à Peel l’accès complet au disque pour qu’il y regarde aussi."+ }+ },+ "one" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Aucun programme d’installation n’a été trouvé, mais Peel n’a pas pu regarder dans %lld dossier, qui peut donc en contenir. Accordez à Peel l’accès complet au disque pour qu’il y regarde aussi."+ }+ },+ "other" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Aucun programme d’installation n’a été trouvé, mais Peel n’a pas pu regarder dans %lld dossiers, qui peuvent donc en contenir. Accordez à Peel l’accès complet au disque pour qu’il y regarde aussi."+ }+ }+ }+ }+ },+ "it" : {+ "variations" : {+ "plural" : {+ "many" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Non sono stati trovati installer, ma Peel non è riuscito a esaminare %lld di cartelle, quindi lì potrebbero essercene. Concedi a Peel l’accesso completo al disco per esaminare anche quelle."+ }+ },+ "one" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Non sono stati trovati installer, ma Peel non è riuscito a esaminare una cartella, quindi lì potrebbero essercene. Concedi a Peel l’accesso completo al disco per esaminare anche quella."+ }+ },+ "other" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Non sono stati trovati installer, ma Peel non è riuscito a esaminare %lld cartelle, quindi lì potrebbero essercene. Concedi a Peel l’accesso completo al disco per esaminare anche quelle."+ }+ }+ }+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "インストーラは見つかりませんでしたが、Peelが調べられなかったフォルダが%lld個あるため、そこにインストーラがある可能性があります。そこも調べられるように、Peelにフルディスクアクセスを許可してください。"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "설치 프로그램을 찾지 못했지만, Peel이 폴더 %lld개를 살펴볼 수 없었으므로 그곳에 있을 수 있습니다. 그곳도 살펴보려면 Peel에 전체 디스크 접근 권한을 부여하십시오."+ }+ },+ "nl" : {+ "variations" : {+ "plural" : {+ "one" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Er zijn geen installatieprogramma's gevonden, maar Peel kon niet in één map kijken, dus daar kunnen er nog zijn. Geef Peel volledige schijftoegang om daar ook te kijken."+ }+ },+ "other" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Er zijn geen installatieprogramma's gevonden, maar Peel kon niet in %lld mappen kijken, dus daar kunnen er nog zijn. Geef Peel volledige schijftoegang om daar ook te kijken."+ }+ }+ }+ }+ },+ "pl" : {+ "variations" : {+ "plural" : {+ "few" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nie znaleziono instalatorów, ale Peel nie mógł zajrzeć do %lld folderów, więc mogą tam jakieś być. Daj aplikacji Peel pełny dostęp do dysku, aby zajrzeć także tam."+ }+ },+ "many" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nie znaleziono instalatorów, ale Peel nie mógł zajrzeć do %lld folderów, więc mogą tam jakieś być. Daj aplikacji Peel pełny dostęp do dysku, aby zajrzeć także tam."+ }+ },+ "one" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nie znaleziono instalatorów, ale Peel nie mógł zajrzeć do %lld folderu, więc mogą tam jakieś być. Daj aplikacji Peel pełny dostęp do dysku, aby zajrzeć także tam."+ }+ },+ "other" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nie znaleziono instalatorów, ale Peel nie mógł zajrzeć do %lld folderu, więc mogą tam jakieś być. Daj aplikacji Peel pełny dostęp do dysku, aby zajrzeć także tam."+ }+ }+ }+ }+ },+ "pt" : {+ "variations" : {+ "plural" : {+ "many" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nenhum instalador foi encontrado, mas o Peel não conseguiu examinar %lld de pastas, então pode haver alguns lá. Dê ao Peel Acesso Total ao Disco para que ele examine lá também."+ }+ },+ "one" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nenhum instalador foi encontrado, mas o Peel não conseguiu examinar %lld pasta, então pode haver alguns lá. Dê ao Peel Acesso Total ao Disco para que ele examine lá também."+ }+ },+ "other" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nenhum instalador foi encontrado, mas o Peel não conseguiu examinar %lld pastas, então pode haver alguns lá. Dê ao Peel Acesso Total ao Disco para que ele examine lá também."+ }+ }+ }+ }+ },+ "ro" : {+ "variations" : {+ "plural" : {+ "few" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nu s‑au găsit programe de instalare, dar Peel nu a putut căuta în %lld dosare, așa că acolo ar putea exista unele. Acordați aplicației Peel Acces complet la disc pentru a căuta și acolo."+ }+ },+ "one" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nu s‑au găsit programe de instalare, dar Peel nu a putut căuta în %lld dosar, așa că acolo ar putea exista unele. Acordați aplicației Peel Acces complet la disc pentru a căuta și acolo."+ }+ },+ "other" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nu s‑au găsit programe de instalare, dar Peel nu a putut căuta în %lld de dosare, așa că acolo ar putea exista unele. Acordați aplicației Peel Acces complet la disc pentru a căuta și acolo."+ }+ }+ }+ }+ },+ "ru" : {+ "variations" : {+ "plural" : {+ "few" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Установщики не найдены, но Peel не смог заглянуть в %lld папки, так что там они могут быть. Предоставьте Peel полный доступ к диску, чтобы он заглянул и туда."+ }+ },+ "many" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Установщики не найдены, но Peel не смог заглянуть в %lld папок, так что там они могут быть. Предоставьте Peel полный доступ к диску, чтобы он заглянул и туда."+ }+ },+ "one" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Установщики не найдены, но Peel не смог заглянуть в %lld папку, так что там они могут быть. Предоставьте Peel полный доступ к диску, чтобы он заглянул и туда."+ }+ },+ "other" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Установщики не найдены, но Peel не смог заглянуть в %lld папки, так что там они могут быть. Предоставьте Peel полный доступ к диску, чтобы он заглянул и туда."+ }+ }+ }+ }+ },+ "sv" : {+ "variations" : {+ "plural" : {+ "one" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Inga installerare hittades, men Peel kunde inte titta i en mapp, så det kan finnas några där. Ge Peel full skivtillgång för att titta där också."+ }+ },+ "other" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Inga installerare hittades, men Peel kunde inte titta i %lld mappar, så det kan finnas några där. Ge Peel full skivtillgång för att titta där också."+ }+ }+ }+ }+ },+ "tr" : {+ "variations" : {+ "plural" : {+ "one" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Yükleyici bulunamadı ama Peel %lld klasörün içine bakamadı, bu yüzden orada yükleyiciler olabilir. Oraya da bakabilmesi için Peel’e Tam Disk Erişimi verin."+ }+ },+ "other" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Yükleyici bulunamadı ama Peel %lld klasörün içine bakamadı, bu yüzden orada yükleyiciler olabilir. Oralara da bakabilmesi için Peel’e Tam Disk Erişimi verin."+ }+ }+ }+ }+ },+ "uk" : {+ "variations" : {+ "plural" : {+ "few" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Інсталяторів не знайдено, але Peel не вдалося зазирнути в %lld папки, тож вони можуть бути там. Надайте Peel повний доступ до диска, щоб зазирнути й туди."+ }+ },+ "many" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Інсталяторів не знайдено, але Peel не вдалося зазирнути в %lld папок, тож вони можуть бути там. Надайте Peel повний доступ до диска, щоб зазирнути й туди."+ }+ },+ "one" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Інсталяторів не знайдено, але Peel не вдалося зазирнути в %lld папку, тож вони можуть бути там. Надайте Peel повний доступ до диска, щоб зазирнути й туди."+ }+ },+ "other" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Інсталяторів не знайдено, але Peel не вдалося зазирнути в %lld папки, тож вони можуть бути там. Надайте Peel повний доступ до диска, щоб зазирнути й туди."+ }+ }+ }+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "未找到安装器,但有%lld个文件夹Peel无法查看,因此其中可能仍有安装器。授予Peel完全磁盘访问权限,即可一并查看这些文件夹。"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "沒有找到安裝程式,但Peel無法查看%lld個檔案夾,因此那裡可能還有。請給予Peel「完全取用磁碟」權限,讓它也能查看那裡。"+ }+ }+ }+ },"No longer in the Trash" : {"localizations" : {"cs" : {diff --git a/Packages/PeelCore/Sources/PeelCore/Space/Installers.swift b/Packages/PeelCore/Sources/PeelCore/Space/Installers.swiftindex c61d4393..629cae9a 100644--- a/Packages/PeelCore/Sources/PeelCore/Space/Installers.swift+++ b/Packages/PeelCore/Sources/PeelCore/Space/Installers.swift@@ -42,8 +42,11 @@ public struct InstallerItem: Sendable, Hashable, Identifiable {public struct InstallerScan: Sendable {public let items: [InstallerItem]- /// True when device backups are there but macOS won't let Peel read them.- public let backupsNeedFullDiskAccess: Bool+ /// The folders Peel looks in that macOS would not let it read, the device backups' among them, so what is in+ /// them is not known.+ public let unreadableLocations: [URL]++ public var needsFullDiskAccess: Bool { !unreadableLocations.isEmpty }public func items(in kind: InstallerItem.Kind) -> [InstallerItem] {items.filter { $0.kind == kind }@@ -77,12 +80,15 @@ public enum Installers {root: URL,exclusions: Exclusions,minimumSize: Int64,- measure: LeftoverScanner.Measure+ measure: LeftoverScanner.Measure,+ canList: (URL) -> AccessState = FullDiskAccess.canList) async -> InstallerScan {var items: [InstallerItem] = []+ var unreadable: [URL] = []let downloads = ["Downloads", "Desktop", "Documents"].map { home.appending(path: $0, directoryHint: .isDirectory) }for folder in downloads {+ if canList(folder) == .missing { unreadable.append(folder) }for url in files(in: folder) {// The extension is checked before measuring, since measuring a folder walks all of it.let suffix = url.pathExtension.lowercased()@@ -113,15 +119,16 @@ public enum Installers {items += await firmwareFiles(home: home, exclusions: exclusions, minimumSize: minimumSize, measure: measure)let backupFolder = home.appending(path: "Library/Application Support/MobileSync/Backup", directoryHint: .isDirectory)- let readable = FullDiskAccess.canList(backupFolder)+ let readable = canList(backupFolder)if readable == .granted {items += await backups(in: backupFolder, measure: measure)}+ if readable == .missing { unreadable.append(backupFolder) }return InstallerScan(// An unknown size sorts first: an item that ran out of time is most likely one of the biggest.items: items.sorted { ($0.size ?? .max) > ($1.size ?? .max) },- backupsNeedFullDiskAccess: readable == .missing+ unreadableLocations: unreadable)}diff --git a/Packages/PeelCore/Tests/PeelCoreTests/InstallersTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/InstallersTests.swiftindex b97df7a6..3b162642 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/InstallersTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/InstallersTests.swift@@ -114,6 +114,25 @@ struct InstallersTests {#expect(installers.allSatisfy { !$0.isReadOnly })}+ /// macOS asks before an app reads Downloads, Desktop, or Documents. A folder it refused is named, never read as+ /// holding no installers.+ @Test func namesTheFoldersMacOSWouldNotLetItRead() async throws {+ let directory = try TemporaryDirectory()+ try directory.directory("Downloads")+ try directory.file("Desktop/Tool-2.dmg", bytes: 400_000)+ let downloads = PathPattern.comparablePath(of: directory.url.appending(path: "Downloads"))++ let scan = await Installers.scan(+ installedApps: [], home: directory.url, root: directory.url, exclusions: .none, minimumSize: 100_000,+ measure: LeftoverScanner.walk,+ canList: { PathPattern.comparablePath(of: $0) == downloads ? .missing : .granted }+ )++ #expect(scan.unreadableLocations.map { PathPattern.comparablePath(of: $0) } == [downloads])+ #expect(scan.needsFullDiskAccess)+ #expect(scan.items.map(\.name) == ["Tool-2.dmg"])+ }+@Test func findsMacOSInstallersAndDeviceFirmware() async throws {let directory = try TemporaryDirectory()try directory.file("Applications/Install macOS Tahoe.app/Contents/MacOS/app", bytes: 400_000)diff --git a/Peel/Model/InstallerLibrary.swift b/Peel/Model/InstallerLibrary.swiftindex 4dede132..40d23c06 100644--- a/Peel/Model/InstallerLibrary.swift+++ b/Peel/Model/InstallerLibrary.swift@@ -20,8 +20,8 @@ final class InstallerLibrary {scan?.items(in: kind) ?? []}- var backupsNeedFullDiskAccess: Bool {- scan?.backupsNeedFullDiskAccess ?? false+ var needsFullDiskAccess: Bool {+ scan?.needsFullDiskAccess ?? false}func refresh(installedApps: [InstalledApp]) async {diff --git a/Peel/Views/Installers/InstallerList.swift b/Peel/Views/Installers/InstallerList.swiftindex 5bac0046..6d149b34 100644--- a/Peel/Views/Installers/InstallerList.swift+++ b/Peel/Views/Installers/InstallerList.swift@@ -4,6 +4,7 @@ import SwiftUIstruct InstallerList: View {@Environment(AppLibrary.self) private var library@Environment(InstallerLibrary.self) private var installers+ @Environment(HomeModel.self) private var home@State private var isRescanning = false@State private var searchText = ""@@ -21,7 +22,7 @@ struct InstallerList: View {let filtered = listedList(selection: $installers.selection) {- if installers.backupsNeedFullDiskAccess {+ if installers.needsFullDiskAccess {FullDiskAccessBanner()}ForEach(filtered, id: \.self) { kind in@@ -32,7 +33,15 @@ struct InstallerList: View {}.columnSearch(text: $searchText, prompt: "Search Installers and Backups", when: !installers.sections.isEmpty).scanState(phase(filtered), isRescanning: isRescanning, scan: installers.scanRun) {- if installers.sections.isEmpty {+ if installers.sections.isEmpty, let unreadable = installers.scan?.unreadableLocations, !unreadable.isEmpty {+ ContentUnavailableView {+ Label("Not Everything Could Be Read", systemImage: "exclamationmark.triangle")+ } description: {+ Text("No installers were found, but Peel couldn’t look in ^[\(unreadable.count) folder](inflect: true), so there may be some there. Give Peel Full Disk Access to look there too.")+ } actions: {+ Button("Open System Settings") { home.openFullDiskAccessSettings() }+ }+ } else if installers.sections.isEmpty {ContentUnavailableView("Nothing Left Over",systemImage: "checkmark.seal",@@ -44,7 +53,13 @@ struct InstallerList: View {}.fadesInColumn(whenRowsChange: installers.scan?.items.map(\.id)).navigationTitle(Text(Tool.installers.title))- .announcesScan(installers.isScanning, found: installers.summary, wasStopped: installers.scanRun.wasStopped)+ .announcesScan(+ installers.isScanning,+ found: installers.summary,+ couldNotLook: installers.sections.isEmpty && installers.needsFullDiskAccess+ ? "Not Everything Could Be Read" : nil,+ wasStopped: installers.scanRun.wasStopped+ ).toolbar {ToolbarItem {RescanButton(isRunning: $isRescanning, isDisabled: !library.hasLoaded || installers.isRemoving, scan: installers.scanRun) {@@ -61,7 +76,7 @@ struct InstallerList: View {private func phase(_ filtered: [InstallerItem.Kind]) -> ScanPhase {if installers.scan == nil { return installers.scanRun.wasStopped ? .stopped : .scanning(.walk) }- if installers.sections.isEmpty, !installers.backupsNeedFullDiskAccess { return .message }+ if installers.sections.isEmpty { return .message }if !installers.sections.isEmpty, filtered.isEmpty { return .message }return .content}