| name | AnimaMac Debugging |
| description | Debug common AnimaMac issues including permissions, recording failures, GIF export problems, and UI issues. Use when the app isn't working correctly or when troubleshooting errors. |
AnimaMac Debugging
Quick Diagnosis
App won't record
- Check screen recording permission: System Settings > Privacy & Security > Screen Recording
- Ensure AnimaMac is in the list and enabled
- Quit and relaunch the app after enabling permission
GIF not created (only MOV)
Check FFmpeg:
ls ~/Library/Application\ Support/AnimaMac/ffmpeg
~/Library/Application\ Support/AnimaMac/ffmpeg -version
Check export logs in console output for [GIFExporter] and [FFmpeg] messages.
Poor quality GIF
- Check source MOV quality first
- Verify filter chain uses
-filter_complex not -vf
- Check bitrate in ScreenRecorder.swift (should be 20_000_000)
Debug Commands
View Recent Recordings
ls -la ~/Library/Application\ Support/AnimaMac/recordings/
Check Recording Library
cat ~/Library/Application\ Support/AnimaMac/library.json | python3 -m json.tool
Test FFmpeg Manually
~/Library/Application\ Support/AnimaMac/ffmpeg \
-y -i input.mov \
-filter_complex "[0:v]fps=15,scale=640:-2:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=256:stats_mode=diff[p];[s1][p]paletteuse=dither=sierra2:diff_mode=rectangle" \
-loop 0 output.gif
Reset FFmpeg
rm ~/Library/Application\ Support/AnimaMac/ffmpeg
Clear All Data
rm -rf ~/Library/Application\ Support/AnimaMac/
Common Issues
"Permission Required" keeps appearing
Cause: Screen recording permission not granted or app not relaunched.
Fix:
- Open System Settings > Privacy & Security > Screen Recording
- Enable AnimaMac (add if not listed)
- Quit the app completely (not just close menu)
- Relaunch AnimaMac
Why: macOS caches permission state at process start. Must relaunch to pick up changes.
"Record Area" does nothing
Cause: Could be permission issue or overlay not showing.
Debug:
- Check console for "No displays available" or "Failed to get displays"
- If permission error, see above
- If overlay issue, check
OverlayWindowController is initialized in AppState.setupComponents()
Recording stops immediately
Cause: Frame writing failure or AVAssetWriter error.
Debug:
- Check for errors in
SCStreamDelegate.stream(_:didStopWithError:)
- Verify
videoInput.isReadyForMoreMediaData is being checked
- Check disk space in recordings directory
GIF export fails silently
Cause: FFmpeg command error not displayed.
Debug:
- Look for
[GIFExporter] and [FFmpeg] log messages
- Check
FFmpegError.executionFailed error message
- Try manual FFmpeg command (see above)
Common FFmpeg errors:
- "No such filter" - filter chain syntax error
- "Output file is empty" - input file issue
- "Permission denied" - FFmpeg binary not executable
Menu bar icon missing
Cause: App not running or MenuBarExtra issue.
Debug:
- Check Activity Monitor for AnimaMac process
- Look for crashes in Console.app
- Verify
@main entry point in AnimaMacApp.swift
Settings won't open
Cause: @Environment(\.openSettings) not working.
Fix: Ensure using openSettingsAction() not deprecated selector-based approach.
Adding Debug Logging
To add logging for troubleshooting:
print("[ScreenRecorder] Starting capture for display: \(display.displayID)")
print("[GIFExporter] Filter chain: \(filterChain)")
print("[FFmpeg] Exited with code: \(exitCode)")
print("[FFmpeg] Error output: \(errorStr)")
Inspecting State
Key AppState properties to check:
isRecording - should be true during recording
isExporting - should be true during GIF creation
showingError / lastError - error state
selectedDisplay / selectedWindow - what's being recorded
Recovery Steps
If app is in bad state:
- Stop any recording: Cmd+Escape
- Quit app completely
- Delete corrupted recordings if needed
- Relaunch app
If still broken:
rm -rf ~/Library/Application\ Support/AnimaMac/