Closed stevensanborn closed 2 years ago
@stevensanborn , are you test in m1 and does it work smoothly?
I have not tested yet. I intend to eventually but if there is an issue im looking to know sooner rather than later
On Wed, Dec 30, 2020 at 8:27 PM dukehe notifications@github.com wrote:
@stevensanborn https://github.com/stevensanborn , are you test in m1 and does it work smoothly?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/octalmage/robotjs/issues/631#issuecomment-752861544, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHRE2GPYWQBZ2NT4G3NUELSXQKWFANCNFSM4USW5LRA .
-- Steven Sanborn Founder | Software Developer Feedtank (347) 687-2762
Do you haven an m1 chip? I don't think many developers do yet, so if you do - please do test it and report back.
I have the M1 and robotjs is working using rosetta
I do get the following with an electron v11.2.1 app build with the latest electron-builder on an Intel Mac:
Are there any known workarounds of how to compile correctly?
edit: Nevermind it works perfectly if compiled directly on an M1
Yes it does work. Use a terminal with Rosetta enabled.
@danielehrhardt that's a good tip and it is indeed possible, but it actually means "robotjs does not work on m1"
I just integrated robotjs without any issue into my ARM64 Node.js project under macOS Big Sur on a Apple M1 chip. No Rosetta required :) Perhaps this issue is obsolete?
Not sure why this was closed I get the same error as @cliqer on an m1 macbook on macOS Big Sur. @raphaelmenges are you running arm64 node?
I just integrated robotjs without any issue into my ARM64 Node.js project under macOS Big Sur on a Apple M1 chip. No Rosetta required :) Perhaps this issue is obsolete?
How?
@boydy12, it does work perfectly well.
brew install nodejs@16
. This will install the arm64 version of node (remove any other versions)electron@15.3.4
(does not compile with v16 on windows if you use parallels)electron-builder@next
"postinstall": "electron-builder install-app-deps"
within your package.json
yarn
or npm -i
@boydy12, it does work perfectly well.
- use
brew install nodejs@16
. This will install the arm64 version of node (remove any other versions)- Make sure you have
electron@15.3.4
(does not compile with v16 on windows if you use parallels)- use
electron-builder@next
- add
"postinstall": "electron-builder install-app-deps"
within yourpackage.json
- run
yarn
ornpm -i
For me it worked to install v2 npm install @nut-tree/nut-js@2
@danielehrhardt nutjs is a great alternative though around 10x slower on some of its functions/native implementations ie. pressing keys on the host system and out of scope within this thread.
Thanks guys, I think both nutjs and robotjs are maybe a bit overkill for my needs. I only need to run one set of key commands. I think just using exec could work for me better. I'm new to electron but being stuck to one version doesn't seem ideal to me. Definitely useful for other people looking to get this working.
This is my working code for macOS which is what i'm trying to achieve:
import { promisify } from "util";
const exec = promisify(require("child_process").exec);
const lock = async () => {
await exec(`osascript -e 'tell application "System Events" to keystroke "q" using {control down, command down}`);
};
If there is a better way i'm open to suggestions.
@boydy12 or simply use https://github.com/kujirahand/node-sendkeys-js or Applescript ;)
BTW, you are not stuck on a single version and following my suggestions you can compile robot js for any version of electron with arm64.
My recommendation was only if you need to also compile on windows 11 arm64 where it has some limitations with node-gyp and fails most of the time.
sorry im using "issues" to ask a basic question. I'm just wondering if anyone has tested if robotjs will work on the new apple M1 chip?