othyn / macos-auto-clicker

A simple auto clicker for macOS Big Sur, Monterey, Ventura and Sonoma.
MIT License
208 stars 24 forks source link

Corrupted preferences file stops the app from being able to run #62

Open rsparkyc opened 1 year ago

rsparkyc commented 1 year ago

Description

Even when trying to right click and open thing, it will no longer open on the latest macos

Version

1.5.0

Steps to Reproduce

Download app Put in applications folder attempt to open with right click -> open

Screenshots

No response

Device

MacBook Pro

Operating System

macOS 13.3.1

Additional Context

No response

othyn commented 1 year ago

Unfortunately, I can't reproduce this error on my machine to debug it.

I'm running Ventura 13.3.1, tried my existing install and its working okay.

I've also just downloaded a fresh version of 1.5.0 and cleared out all preferences and permissions, its also working okay via the right click open method at first, then just double click from then on.

I can't really do anything more as I can't get it not to work. :/

rsparkyc commented 1 year ago

odd, ok, thanks for looking! Still not sure what's up with mine. I open in with the right click, but it just immediately closes. I even tried opening it from the command line to see if there was an exit code or something, but didn't much of anything, just this:

➜  /Applications/Auto Clicker.app/Contents/MacOS ./Auto\ Clicker                                                                                                                                              [5:11:19 PM]
[1]    48824 trace trap  ./Auto\ Clicker
rsparkyc commented 1 year ago

I think I had a bad plist file. After deleting it and running killall -u <user-name> cfprefsd, the app comes up just fine.

For reference, this is what my file looked like before:

➜  ~/Library/Preferences cat com.othyn.auto-clicker.plist
bplist00�

_menu_bar_hide_dock_!KeyboardShortcuts_pressStopButton_user_form_state_"KeyboardShortcuts_pressStartButton_appearance_selected_theme_+com_apple_SwiftUI_Settings_selectedTabIndex_0NSWindow Frame com_apple_SwiftUI_Settings_window_eNSWindow Frame SwiftUI.ModifiedContent<Auto_Clicker.ACWindow, SwiftUI._FlexFrameLayout>-1-AppWindow-1  _+{"carbonModifiers":2560,"carbonKeyCode":49}_�{"pressInterval":50,"pressIntervalDuration":"duration_milliseconds","repeatAmount":5000,"pressInput":{"isRepeat":false,"isMouseInput":true,"modifiers":[],"type":1,"keyCode":0,"readable":"Left Click"},"pressAmount":5,"startDelay":0_{"currentColour":{"Indigo":{}}}_1167 733 532 242 0 0 2560 1415 _644 632 715 458 0 0 2560 1415.Rd���no�������%

This is after:

➜  ~/Library/Preferences cat com.othyn.auto-clicker.plist
bplist00_eNSWindow Frame SwiftUI.ModifiedContent<Auto_Clicker.ACWindow, SwiftUI._FlexFrameLayout>-1-AppWindow-1_!KeyboardShortcuts_pressStopButton_"KeyboardShortcuts_pressStartButton_user_form_state_922 516 715 458 0 0 2560 1415 _*{"carbonModifiers":2304,"carbonKeyCode":7}_*{"carbonModifiers":2304,"carbonKeyCode":1}_�{"pressInterval":50,"pressIntervalDuration":"duration_milliseconds","repeatAmount":100,"pressInput":{"isRepeat":false,"isMouseInput":true,"modifiers":[],"type":1,"keyCode":0,"readable":"Left Click"},"pressAmount":1,"startDelay":1y����"O 8%
othyn commented 1 year ago

Interesting... thank you for debugging and sharing a working solution. I'm not 100% sure what the issue is based on that snipped due to the encoding, but at a guess the app didn't cleanly write the preferences file.

I should perhaps add in a provision for the preferences file being corrupted during app boot.

I'll re-open this issue and re-title it, although not sure when I'll get around to adding that provision in.

Thanks again!