codesign error - No such file or directory

I'm having a problem with codesign for output from Pyinstaller

The files are in ~/PycharmProjects/ALP_Document_Factory_II

That folder contains the icon file, the entitlement file, and also contains a "dist"  folder where Pyinstaller places the app file (ALP_Document_Factory_II.app)

The generated app works and runs when I double click it.

When I run codesign:

codesign -s xxxxxxxx -f --entitlements entitlements.plist -o runtime dist/ALP_Document_Factory_II.app

  ("xxxxxxx" is where I place the hash of my credential)

I get the following error message: No such file or directory

Here is the Terminal copy... minus my Hash

dickl45@Dicks-iMac3 ALP_Document_Factory_II % codesign -s xxxxxxxxxx -f --entitlements entitlements.plist -o runtime dist/ALP_Document_Factory_II.app dist/ALP_Document_Factory_II.app: No such file or directory

Earlier I was able to use codesign and notarytool, but I must be doing something wrong that I can't see.

Yours baffled

MacOs 15.2

Answered by DTS Engineer in 822678022

Thanks for that. I downloaded your app and was able to sign it just fine:

 % sw_vers
ProductName:            macOS
ProductVersion:         15.2
BuildVersion:           24C101
% 
% codesign -s - -f "ALP_Document_Factory_II  .app"
ALP_Document_Factory_II  .app: replacing existing signature

The one thing I noticed is that your app name contains weird characters. Note the ‘gaps’ in the shell completed name above. Now consider this:

% ls | xxd
00000000: 414c 505f 446f 6375 6d65 6e74 5f46 6163  ALP_Document_Fac
00000010: 746f 7279 5f49 49c2 a0c2 a02e 6170 700a  tory_II.....app.
00000020: 414c 505f 446f 6375 6d65 6e74 5f46 6163  ALP_Document_Fac
00000030: 746f 7279 5f49 49c2 a0c2 a02e 7a69 700a  tory_II.....zip.

Each c2 a0 sequence is a U+00A0 NO-BREAK SPACE. Did you add those deliberately? If not, I recommend that you remove them.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Yours baffled

This is a weird error. I’ve seen in before [1] but I’ve not yet worked out exactly how to trigger it.

Problems like this are almost always the result of folks not following the rules described in Placing Content in a Bundle. However, it’s hard to debug this with just the error message you’re getting from codesign.

Two things:

  • If you add more -v flags to codesign, does the verbose logging reveal anything?

  • If not, are you willing to share a copy of the ALP_Document_Factory_II.app? If so, zip it up and reply here with the URL.

ps I recommend you have a read of Quinn’s Top Ten DevForums Tips. Specifically tip 5’s info about preformatted text and tip 14 about posting URLs.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] For example, here.

I did add -v flag ( just before the path name ), but that did not result in any additional text beyond the original error message. I also looked a the package content of the app file, and it seemed to match what is described in the documentation. I am providing the link to the zipped app.... thank you https://www.icloud.com/iclouddrive/00aSwLnMNH2HvTiDyqDJLk45g#ALP%5FDocument%5FFactory%5FII%C2%A0%C2%A0

Accepted Answer

Thanks for that. I downloaded your app and was able to sign it just fine:

 % sw_vers
ProductName:            macOS
ProductVersion:         15.2
BuildVersion:           24C101
% 
% codesign -s - -f "ALP_Document_Factory_II  .app"
ALP_Document_Factory_II  .app: replacing existing signature

The one thing I noticed is that your app name contains weird characters. Note the ‘gaps’ in the shell completed name above. Now consider this:

% ls | xxd
00000000: 414c 505f 446f 6375 6d65 6e74 5f46 6163  ALP_Document_Fac
00000010: 746f 7279 5f49 49c2 a0c2 a02e 6170 700a  tory_II.....app.
00000020: 414c 505f 446f 6375 6d65 6e74 5f46 6163  ALP_Document_Fac
00000030: 746f 7279 5f49 49c2 a0c2 a02e 7a69 700a  tory_II.....zip.

Each c2 a0 sequence is a U+00A0 NO-BREAK SPACE. Did you add those deliberately? If not, I recommend that you remove them.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thank you... the extra characters were a result of my (incorrectly) putting quotes on the string for the --name option

codesign error - No such file or directory
 
 
Q