apps

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package apps enumerates installed macOS applications and classifies each app binary's CPU architecture (Intel / Universal / Apple Silicon), so the GUI can flag Intel-only apps that run under Rosetta on Apple Silicon.

The arch parsing (debug/macho) is byte-level and works on any OS, so the logic here is cross-platform and unit-tested on Linux CI. Only the install roots and the host-hardware check (apps_darwin.go) are darwin-specific.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BundleInfo

func BundleInfo(appPath string) (exe, bundleID string)

BundleInfo returns an app's CFBundleExecutable and CFBundleIdentifier.

func HostIsAppleSilicon

func HostIsAppleSilicon() bool

HostIsAppleSilicon is false off macOS.

Types

type App

type App struct {
	Path     string // …/Foo.app
	Name     string // "Foo"
	BundleID string // com.acme.foo ("" if unreadable)
	Bytes    int64
	Arch     Arch
}

App is one installed application.

func Scan

func Scan(_ string, _ func(App), _ <-chan struct{}) []App

Scan is darwin-only; on other platforms there are no macOS apps to audit.

type Arch

type Arch int

Arch is an app binary's architecture classification.

const (
	ArchUnknown      Arch = iota
	ArchIntel             // x86_64 / i386 only — runs under Rosetta on Apple Silicon
	ArchAppleSilicon      // arm64 only — native
	ArchUniversal         // both — runs native
)

func ArchOf

func ArchOf(exePath string) Arch

ArchOf classifies the executable at path. Unreadable or non-Mach-O files (scripts, missing executables) classify as ArchUnknown.

func (Arch) String

func (a Arch) String() string

type Leftover

type Leftover struct {
	Path  string
	Bytes int64
}

Leftover is a support file/dir associated with an app's bundle id.

func Leftovers

func Leftovers(home, bundleID string) []Leftover

Leftovers returns existing support files/dirs whose name is an EXACT match for the bundle id under the standard ~/Library locations, each with its size. Exact matching avoids over-matching neighbors (com.acme.foo vs com.acme.foobar).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL