Background
I have a bunch of OS X Yosemite Mac Minis that are used as slaves by a Jenkins master machine to run Selenium tests using Google Chrome.
These slave machines get restarted on a daily basis.
Problem
After the restart, the machines are at a login screen asking for a username and password. Running Google Chrome remotely on the machines fails until a manual login is performed.
Is there a way to automate this login?
Things I have tried
- Executing a login script remotely on the Mac Mini using
ssh root@<macmini-address> "bash -s" < ./login.sh
where login.sh contains the following:
#!/bin/bash osascript <<EOF tell application "System Events" keystroke "<replace with user>" keystroke tab delay 0.5 keystroke "<replace with password>" delay 0.5 keystroke return keystroke return end tell EOF
This results in the following error:
33:49: execution error: An error of type -10810 has occurred. (-10810)
- Sending the above AppleScript to the Mac Mini through Apple Remote Desktop (ARD).
This works but on some occasions, ARD is not able to send the script over to some Mac Minis showing a 'Client Software Not Active' message in the ARD status column.
Best Answer
macOS has an automated login feature.
Not all accounts work for automatic login. If you can't select your account, make sure FireVault is turned off and the account doesn't use an iCloud password for the login.