Notarize issue: altool not in PATH?

992 views Asked by At

OSX version: 10.14.6
electron-builder: 22.11.1
electron-notarize: 1.0.0

I've been trying to notarize an Electron app using the latest version of Electron Builder, however I keep getting the error:

error: unable to find utility "altool", not a developer tool or in PATH

I've seen the other questions related to this issue and based on the suggestions, I've removed, reinstalled and selected the CommandLineTools using:

sudo rm -rf /Library/Developer/CommandLineTools   
xcode-select --install   
sudo xcode-select -r

Check the path:

xcode-select -p
/Library/Developer/CommandLineTools

This is in the 'Library' directory at the root level of the drive, not the "user" account "Library" directory. So that's all good (I guess) but I still get the above error. Also, if I look in the directory /Library/Developer/CommandLineTools/usr/bin I do not see this "altool". Is it somewhere else?

Am I doing something obviously wrong? If I output the PATH (below) I don't see any reference to the CommandLineTools directory. Is it odd that the installer pkg did not do that?

I'm hesitant to "try anything" but I am getting to that point. What can I try next?

echo "$PATH"
/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/sbin

1

There are 1 answers

0
Trev On BEST ANSWER

You need to install Xcode – the command line tools do not include altool, but Xcode does.

Assuming you install Xcode to /Applications you will find altool at:

/Applications/Xcode.app/Contents/Developer/usr/bin/altool

So you could edit your ~/.bashrc to update the path:

export PATH="/Applications/Xcode.app/Contents/Developer/usr/bin/:$PATH"