Notarizing PB-Apps

Mac OSX specific forum
jamirokwai
Enthusiast
Enthusiast
Posts: 798
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Notarizing PB-Apps

Post by jamirokwai »

Hi there,

maybe, I accomplished the notarization of my PureBasic-App. It's for M1-Macs, please try it out.

The Process is very easy :-/

0. Register for the Developer Program at Apple (99 Bucks/year), may be also working with a free account. You get certificates and stuff, which are important for this. So you have a developer Apple-ID and the "Developer ID Application: xxx"

1. Create your myapp.app

2. Register a new bundle-id (e.g. com.ducks-on-the-water.retro-painter) and create an App (that may be omitted, but I created it)
https://developer.apple.com/account/res ... add/bundle

3. Add an App-specific password in your developers Apple-ID
https://appleid.apple.com/account/manage

4. Codesign your App

Code: Select all

codesign --force --options runtime --timestamp --sign "Developer ID Application: xxx" "/path/to/myapp.app"
5. zip it to my myapp.app.zip

6. notarise it

Code: Select all

xcrun notarytool submit "/path/to/myapp.app.zip" --apple-id "the one used in step 2" --password "from step 3" --team-id "find in step 3"
you will get an ID

7. after a few minutes, have a look into the log

Code: Select all

xcrun notarytool log "ID from step 6" --apple-id "the one used in step 2" --password "from step 3" --team-id "find in step 3"
8. unzip it

9. staple it

Code: Select all

xcrun stapler staple "/path/to/myapp.app"
10 check it

Code: Select all

spctl --assess -vv --type install "/path/to/myapp.app"
11. zip it again and ship it!

That's it. Apples Transporter.app only accepts .PKG. If I succeed in signing and notarizing .PKG as well, I will edit the next post!
Last edited by jamirokwai on Thu Feb 09, 2023 2:05 pm, edited 4 times in total.
Regards,
JamiroKwai
jamirokwai
Enthusiast
Enthusiast
Posts: 798
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Notarizing PB-App

Post by jamirokwai »

reserved
Regards,
JamiroKwai
jamirokwai
Enthusiast
Enthusiast
Posts: 798
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Notarizing PB-Apps

Post by jamirokwai »

If you want to combine the M1 and the x64-binary, use LIPO on the command line.

Code: Select all

lipo -create "/path/to/m1.app/Contents/MacOS/m1" "/path/to/x64.app/Contents/MacOS/x64" -output "universal"
You can check the app with

Code: Select all

file ./universal
Now you can sign and notarize the App. See first post.



Edit, because of mrbungles question below.

You have to copy the file universal into the .app-bundle, under Contents/MacOS. If you user the bundle /path/to/m1.app/Contents/MacOS/m1, replace the file m1 with the file universal, but rename it to m1.

Code: Select all

file ./path/to/m1.app/Contents/MacOS/universal"
spat out this:

Code: Select all

./universal (for architecture x86_64): Mach-O 64-bit executable x86_64
./universal (for architecture arm64):  Mach-O 64-bit executable arm64
Last edited by jamirokwai on Fri Feb 10, 2023 10:16 pm, edited 3 times in total.
Regards,
JamiroKwai
Fred
Administrator
Administrator
Posts: 18220
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Notarizing PB-Apps

Post by Fred »

I did the same for the PB package and it was really a pain to do.. Thanks for the detailed guide, it can help.
mrbungle
Enthusiast
Enthusiast
Posts: 149
Joined: Wed Dec 30, 2020 3:18 am

Re: Notarizing PB-Apps

Post by mrbungle »

Thanks for posting this. I was able to generate a universal build of a simple app but it didn't execute properly (it loaded but nothing else). Is there anything else we need to do to get this to work properly? Like set some permissions or flags?
jamirokwai
Enthusiast
Enthusiast
Posts: 798
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Notarizing PB-Apps

Post by jamirokwai »

mrbungle wrote: Fri Feb 10, 2023 1:14 pm Thanks for posting this. I was able to generate a universal build of a simple app but it didn't execute properly (it loaded but nothing else). Is there anything else we need to do to get this to work properly? Like set some permissions or flags?
Hey, mrbungle!

No, no permissions or flags were needed on my Mac.
See the post above. I added a few sentences. It's working this way!
Regards,
JamiroKwai
mrbungle
Enthusiast
Enthusiast
Posts: 149
Joined: Wed Dec 30, 2020 3:18 am

Re: Notarizing PB-Apps

Post by mrbungle »

Ah ok. This makes sense now, yeah I think I got it to work!

Thanks!
Post Reply