MacOS 10.11.6下无法通过命令行运行SikuliX脚本求助
Hey there, let's break down your SikuliX problems and fix them one by one!
1. Missing runsikulix Command: Why & How to Fix
First off, the runsikulix command isn't automatically added to your system's PATH when you install SikuliX.app — that's why you can't find it by default. Here's what you can do:
Locate the command first: It lives inside the SikuliX app bundle. Open Terminal and run this to confirm it exists:
ls /Applications/SikuliX.app/Contents/MacOS/You should see
runsikulixlisted here.Make it globally accessible (pick one method):
- Option 1: Create a symbolic link (quickest fix):
Enter your admin password when prompted, and you'll be able to runsudo ln -s /Applications/SikuliX.app/Contents/MacOS/runsikulix /usr/local/bin/runsikulixrunsikulixfrom any terminal window afterward. - Option 2: Add to your PATH permanently:
Open your shell config file (like~/.bash_profilefor Bash or~/.zshrcfor Zsh) in a text editor, then add this line:
Save the file, then runexport PATH="/Applications/SikuliX.app/Contents/MacOS:$PATH"source ~/.bash_profile(or the corresponding file for your shell) to apply the change immediately.
- Option 1: Create a symbolic link (quickest fix):
2. Fixing the open Command Error
Your original open command syntax is incorrect — the -r flag can't be passed directly to open like that. Here are two working alternatives:
Use
runsikulixdirectly (recommended):
Once you've set up the command globally (or use the full path), run your script with:runsikulix -r ./agilent/test.sikuli # Or full path if you didn't set up PATH: /Applications/SikuliX.app/Contents/MacOS/runsikulix -r ./agilent/test.sikuliIf you prefer using
open:
You need to use the--argsflag to pass parameters to SikuliX.app:open /Applications/SikuliX.app --args -r ./agilent/test.sikuliNote: Make sure the path to your
test.sikuliis correct — runls ./agilent/test.sikulifirst to confirm the directory exists and contains your script files.
内容的提问来源于stack exchange,提问作者David J.

