Need help with Mac terminal commands?

My Unix days are long, long ago. The goal here is to get Gatekeeper to allow an app to run. Please refer to the photo.

Background:
At Step 1, I ask for a listing of Desktop to verify that the app that I want to allow, FireCapture v2.6, is present.

At Step 2, I issue a command to Gatekeeper to add the exception. It fails.

At Step 3, I issue the same command as a superuser. The command fails.

After Step 3, but before Step 4, I rename FireCapture v2.6.app to FireCapture.app. You can see the Finder is showing the name of the app as FireCapture.app

At Step 4 I issue the same command as Step 3 and it works. Subsequent testing of the app verifies that Gatekeeper now allows the app to launch.

Question 1:
Why did the commands fail when the app name was FireCapture v2.6.app, but succeeded when the name was changed to FireCapture.app?

Question 2:
Was it necessary to issue the command as superuser once I had the name fixed or would the command have worked without the sudo?

2018-07-23T22:13:57Z

Arg. Y! Answers has made a mess of the screen shot.

The relevant commands and responses are:
1) command: ls ~/Desktop
response: list of files, including FireCapture v2.6.app

2) command: spctl --add ~/Desktop/FireCapture v2.6.app
response: invalid API object reference

3) command: sudo spctl --add ~/Desktop/FireCapture v2.6.app
response: invalid API object reference

4) command: sudo spctl --add ~/Desktop/FireCapture v2.6.app
response: [success]

opurt2018-07-23T23:58:52Z

Favorite Answer

As pointed out put the file name or path in 'quotes' when it has spaces in it.

You can also press TAB as you're typing the name and it will automatically expand to the full name, adding quotes as needed. For example, if you type Gate then press TAB, it will replace it with the first file that starts with Gate. Keep pressing TAB and it will step through the rest of the matching files if there's more than one.

G. Whilikers2018-07-23T22:13:19Z

The shell interpreted the spaces in the name as word separators. Try enclosing the name in quotes or escaping the spaces and other special characters (when used).