System Requirements
Operating System
Spank only runs on macOS. Other operating systems (Linux, Windows) are not supported because the accelerometer access depends on macOS-specific IOKit HID APIs.
Hardware
Spank requires Apple Silicon M2 or newer chips.Supported:
- M2, M2 Pro, M2 Max, M2 Ultra
- M3, M3 Pro, M3 Max, M3 Ultra
- M4, M4 Pro, M4 Max (and future Apple Silicon releases)
- Intel-based Macs (no accessible accelerometer)
- M1 series (accelerometer hardware/driver differences)
Privileges
Spank must run with root privileges (Source: main.go:208-210
sudo) to access the IOKit HID accelerometer device.Why sudo is required:- IOKit HID framework requires elevated permissions to open hardware device connections
- The Bosch BMI286 IMU sensor is accessed as a protected system device
- macOS security policies restrict non-root access to raw sensor data
Software Dependencies
Runtime Dependencies
Spank is a single statically-linked binary with no external runtime dependencies. All required libraries are compiled into the executable:- Audio playback libraries (beep, oto)
- MP3 decoder (go-mp3)
- Accelerometer sensor libraries (apple-silicon-accelerometer)
- Embedded audio files (pain/sexy/halo modes)
Build Dependencies
If building from source, you need:Go 1.26 or later is required to compile Spank.See go.mod:3 for the minimum Go version.Install Go from golang.org or via Homebrew:
Installation Methods
Pre-built Binary (Recommended)
Download the latest release from GitHub:Build from Source
Requires Go 1.26+:~/go/bin/spank (or $GOPATH/bin/spank).
Permissions & Security
IOKit HID Access
Spank uses the IOKit HID framework to read accelerometer data directly from the hardware. This is a low-level macOS API that requires root privileges. What Spank accesses:- Bosch BMI286 IMU sensor (accelerometer + gyroscope)
- Reads 3-axis acceleration data (X, Y, Z) at ~100-200 Hz
- No network access, no file system writes (except audio playback)
- Spank does not require Full Disk Access
- Spank does not require Accessibility permissions
- Spank does not require Screen Recording permissions
- Running with
sudogrants IOKit access but does not expose other system resources
Running as a Service
When configured as a launchd service (see Usage Guide), Spank runs as root automatically. The launchd plist should be placed in/Library/LaunchDaemons/ (system-level) rather than ~/Library/LaunchAgents/ (user-level).
Source: README.md:70-183
Compatibility Matrix
| Component | Requirement | Notes |
|---|---|---|
| macOS Version | 12.0+ (Monterey or later) | Older versions may work but are untested |
| Chip | Apple Silicon M2+ | M1 not supported due to hardware differences |
| Architecture | ARM64 | Intel x86_64 not supported |
| Privileges | Root (sudo) | Required for IOKit HID access |
| Audio Output | Built-in or external speakers | Any macOS-compatible audio device |
Troubleshooting
”Permission denied” errors
Symptom: Cannot access accelerometer Solution: Always run withsudo:
“No such device” errors
Symptom: Accelerometer device not found Possible causes:- Running on Intel Mac (not supported)
- Running on M1 chip (not supported)
- Sensor driver not loaded (rare, try reboot)
No audio output
Symptom: Slaps are detected but no sound plays Possible causes:- System volume muted
- Audio output device disconnected
- Check logs for MP3 decode errors