BlueM / cliclick

macOS CLI tool for emulating mouse and keyboard events
https://www.bluem.net
Other
1.59k stars 116 forks source link

"The command terminated due to receipt of a signal." #159

Open 2oh1 opened 1 year ago

2oh1 commented 1 year ago

I bought a new Mac. Now, any of my scripts that use Cliclick return this error: "The command terminated due to receipt of a signal." number 1009

If I try to execute the command directly in Terminal, I get this response: zsh: killed cliclick

I'm using a brand new Mac Studio running Mac OS 12.6

BlueM commented 1 year ago

What cliclick version is it, was it installed thru Homebrew, MacPorts oder via download? What happens when you run it directly in Terminal (not from a script)?

2oh1 commented 1 year ago

I downloaded Cliclick from: https://www.bluem.net https://www.bluem.net/

Version 5.0.1

When I try to run it directly from Terminal, I get this response: "zsh: killed"

I've been using Cliclick for years. Maybe 8 or 9? I never had a problem until I bought a new Mac. Could the issue have something to do with this being an M1 Mac? It's a Mac Studio.

I don't use Homebrew or MacPorts.

On Oct 8, 2022, at 11:11 PM, Carsten Blüm @.***> wrote: What cliclick version is it, was it installed thru Homebrew, MacPorts oder via download? What happens when you run it directly in Terminal (not from a script)?

— Reply to this email directly, view it on GitHub https://github.com/BlueM/cliclick/issues/159#issuecomment-1272465391, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFZ6RTVYMGP37G3U4S3JPTWCJOYVANCNFSM6AAAAAAQ55KB2A. You are receiving this because you authored the thread.

BlueM commented 1 year ago

Possibly a permission issue. Try right-clicking cliclick’s icon (despite the fact that it’s a Terminal application) and choose “Open …” from the contextual menu. I don’t have a Mac with a Silicon CPU myself, but I’ve been told that the first time doing so, macOS won’t allow opening it (and only display a warning along the lines of “macOS cannot verify the integrity of this app“), but upon second attempt, the dialog which shows up will contain an “Open” button.

2oh1 commented 1 year ago

"I’ve been told that the first time doing so, macOS won’t allow opening it (and only display a warning along the lines of “macOS cannot verify the integrity of this app“), but upon second attempt, the dialog which shows up will contain an “Open” button."

That's correct. I had to do that before I could get Cliclick to launch the first time. It doesn't have anything to do with it being an M1 Mac though. It's just Apple's way of making the user confirm an unknown app.

If I right-click Cliclick and select "Open" it opens a Terminal window which says this:

cliclick ; exit; zsh: killed

Saving session... ...copying shared history... ...saving history...truncating history files... ...completed.

[Process completed]

BlueM commented 1 year ago

Well … the fact that your Mac has a M1 CPU is relevant insofar, as you have to use the contextual menu twice, while on Intel it works upon first attempt.

Regarding your problem: I don’t really have an explanation for this. Do you find any relevant output in Console.app? Maybe something along the lines of Security policy would not allow process: 34921, /Users/cb/Downloads/cliclick/cliclick?

2oh1 commented 1 year ago

That's exactly it:

ASP: Security policy would not allow process

If I select cliclick and Get Info, under Sharing & Permissions it says:

You can read and write

Next to my username, in the Get Into window, it says (Me) "Read & Write." For "staff" and "everyone" it says "Read Only"

2oh1 commented 1 year ago

UPDATE: I gave up on using the downloadable cliclick and installed it using homebrew. The homebrew install works.

While trying to find a solution to this issue, I found someone else who was experiencing it too: ["zsh: kills my binary?"

macmesupport commented 4 months ago

I have the same issue it is killed with 9 every time. I downloaded a fresh version (last time I used it in 2022, version 5.0.1 and that worked, but probably on an Intel Mac, not sure though) and with the new version I got the std messages, on the first attempt: "cannot be started, it is from an unidentified dev" or alike, I went to system settings (Sonoma), Security and it was there, with the button "allow", I did, now it created a popup "are you sure you want to open it", and clicked open, and it got killed again. If I right click and open, it has the same result as 2oh1 reported. It does have an xattr apple.com.quarantene which I removed, but it is still killed. And I see in the console the "default 12:50:39.321850+0200 kernel ASP: Security policy would not allow process: 79805, /Users/macme/Downloads/cliclick new/cliclick" I would appreciate any help.

DavidMBrown commented 4 months ago

I received the message "zsh:killed". I resolved it by giving cliclick Accessibility access in System Settings > Privacy & Security.

macmesupport commented 4 months ago

Thanks David, did not help. MBMBAir:cliclick new macme$ ./cliclick -h Killed: 9 I'm always getting 9 Console again returned default 21:55:02.809787+0200 kernel ASP: Security policy would not allow process: 84519, /Users/macme/Downloads/cliclick new/cliclick

DavidMBrown commented 4 months ago

Something just occurred to me. If my memory is correct, I also needed to give Accessibility permission to Terminal. Also, you might try removing cliclick, resetting all its permissions with tccutil, followed by reinstalling, giving Accessibility permission before running cliclick, and running cliclick by right clicking on it and selecting Open from the contextual menu that appears. Lastly, cliclick's location might be an issue; I have it in /usr/local/bin. I hope one of these works for you.

macmesupport commented 4 months ago

Hello David, as far as I remember, there was no installation, just an archive which I unpacked. I gave accessibility to termina and it did not help. I would try the tccutil but can you tell me which service would that be, if any, or bundle id? I would prefer not to reset all. Thanks.

DavidMBrown commented 4 months ago

Your statement "there was no installation" is confusing. At the risk of being offensively detailed but in order to be thorough, I'll start at the beginning. I get a clean start, I suggest deleting any cliclick files on your system. If you want to remove existing security permissions for cliclick use the utility tccutil; you can read its man page, but there is next to no information. To remove permissions for only cliclick, the command is tccutil reset All cliclick Next, from BlueM's cliclick page, https://github.com/BlueM/cliclick, you want to download the compiled program, so click on "Releases" (towards the right side of the page.) This opens a new page whose top post is about cliclick version 5.1. Three downloads are available; you want the one entitled cliclick.zip. Download and open that file. You'll have a folder containing two files, the program (named, simply, cliclick) and a Read Me file. The Read Me has instructions for where the file "cliclick" needs to me moved. After you have done that, give the cliclick file Accessibility permission. Run cliclick by right clicking on it and selecting Open from the contextual menu that appears. I hope this helps. Let me know how it goes.

macmesupport commented 4 months ago

Hello David, no offence taken, in fact, thanks a lot for explaining this from the ground 0, because I can follow it exactly and then we are on the same page. Spoiler: it did not work. Here is what I did:

Now that it is present on the file system, I tried the tccutil again, same error, no bundle found

There is only one unusual thing I noticed, when I wanted to grand acessiblity permission, it asks me to authenticate, but it offers me the second account (also admin) on my Mac, not the one I'm logged in with. Both accounts are admin accounts

launching it with sudo produces the same result.

If you want to have a session with me, you are welcome, I would be happy if I could help you to figure this out. I'm GMT+2

DavidMBrown commented 4 months ago

I’d be happy to try a session with you; what did you have in mind? I’m in Eastern Daylight Time Zone, which is four hours behind GMT.