OS X: Distribution to Mac App Store signing troubles - macos

I'm stuck with a problem, when I set Signing (General target's tab) to Mac App Store, it changes target's Build Settings -> Code Signing Identity to a Mac Developer.
And vice-versa if I set Code Signing Identity to 3rd Party Mac Developer Application:... Xcode changes Signing (at the General tab) to None. Stuck with it, maybe someone encounter this? Thanks.
Achieving project as is doesn't allow me to Upload / Validate project.
I want to mention, also, that my goal is to upload the app to App Store (Mac of course). I also have helper application in my bundle, it have its own bundle ID.

Related

signed electron app shell.openItem() fails

I want my Electron app could open *.txt-files (generated by my app) with system default application (default text editor).
I use shell.openItem(path) to perform it - and it worked fine... until I've packed (mas) and signed the app. I suppose I have to add some entitlements when signing, but already tried bunch of them without success :(
Could anyone give me a hand with that?
Unfortunately Electron disables the shell.openItem() API in Mac App Store builds. From their signing guide:
[shell.openItem()] will fail when the app is signed for distribution in the Mac App Store. Subscribe to #9005 for updates.
However, there is a work-around that will enable you to have the same functionality:
shell.openExternal('file://' + myFilePath);
This approach is also confirmed to pass the Apple Store Reviews (see here).

Run Mac App with CloudKit connected to the Production environment

Has anyone succeeded to run a Developer ID signed Mac App with CloudKit and with access to the Production environment, using Xcode 8 beta 3? According to this diagram of Apple it should be possible, but all my attempts lead to crashes. What are the exact steps to follow?
My attempts until now includes the use of a "Mac DirectDistribution" Provisioning Profile that points to an App ID with CloudKit enabled and with access to an iCloud Container.
My CloudKit enabled-app works perfectly with a standard App Store configuration, but I want to test it with a Production environment.
Just add the following entry to your entitlement plist and do a clean build (shift+command k). No other action is needed: (string to copy: com.apple.developer.icloud-container-environment)
After countless experiments I found the following working solution to test CloudKit on the Mac with Production data, using Xcode 7.3:
In your App project, choose Developer ID in Targets > Identity > Signing
In the Entitlements file add a new line with key "com.apple.developer.icloud-container-environment" with value "Production"
Run the App (debug modus)
Export the app to an Archive, choose Export and select "Export as a Mac Application" to produce a Developer ID-based release version.
The steps are more or less the same if you use Xcode 8, but you have the extra option to disable the App Sandbox.
For Mac the easiest way is to just after Archive click Distribute App then choose Development and click next then choose your iCloud Environment (Production/Test) and save the app wherever you want. This version will access your production iCloud.
enter image description here
enter image description here

Distributing Apps Outside the Mac App Store crash with Code Signature Invalid error

I have a Mac App for OS X 10.10 that I am trying to create a working release build.
Not for the Mac App store "Distributing Apps Outside the Mac App
Store"
Uses "Developer ID Application" for the release code signing. Things look good in my App dev account
Created an OSX APP ID com.blah.app
Can create and verify an Archive successfully
sudo spctl --assess --verbose=4 Name.App, looks good "Name.App : accepted
source=Developer ID"
Read thru Apple "Distributing Apps Outside the Mac App Store"
Needs to be OS X 10.10 due to customer requirements
Read through everything I can find on stack overflow regarding this
matter
Can build and release iOS without a second thought, but this is my
first Mac App
I run the App and in the console I see "EXC_CRASH (Code Signature Invalid)"
Stumped ...
Gatekeeper
Macs have a "gatekeeper" feature that can be set in 3 modes in System Preferences > Security & Privacy > General > "Allow apps downloaded from:".
Which is your test system set to ?
Since you're signing using a Developer ID, it needs to be set to the 2nd or 3rd option (not just allowing the App store). [2nd option is the default on freshly installed machines]
Build for distribution outside of the app store
Builds that you create for submission to the App store cannot be run by everybody. One needs to build it specifically for that.
To quote https://developer.apple.com/library/mac/qa/qa1884/_index.html :
[...] use Xcode Organizer > Export > Export a Developer ID-signed Application. Developer ID-signed apps can be run by anyone. However, code that uses technologies only available to Mac App Store apps, such as receipt validation, iCloud, and push notifications, will not work if your app is Developer ID-signed. You might need to temporarily disable those parts of your app if you opt for the Developer ID testing approach
There was an error in the selected capabilities (red) that wasn't stopping the build, "Key chain sharing" in this case. Turned off as I didn't need it and everything works as expected

Adding Mac App Distribution Certificates

I'm trying to add Distribution Certificates for my Mac App (for distribution outside the Mac App Store).
However I stumbled upon this:
I am unable to select the Developer ID option. It is disabled. I have revoked all my Certificates in the Production Panel as well as in the Development Panel but still with no luck.
Any help would be very much appreciated.
It might be because you need to set in Xcode that you intend to distribute your application outside of the Mac App Store and then request Developer ID certificates.
Go to the Xcode project settings and under Signing, select Developer ID as the signing identity. After that Xcode will help you to create a Developer ID Certificate for you.
Refer the doc for more details :
App Distribution Guide - Apple

Self-signed certificate for code signing not showing up in Xcode 4

I'm developing a small app on Xcode 4.2 in Lion to learn the basics of Mac development.
I've got a directory picker controller class as an NSOpenSavePanelDelegate, implementing the - panel:validateURL:error: method, where I'm attempting to make sure that the directory that the user chooses contains files of a certain type that the app supports.
I stumbled across this question here on SO, discovering that the delegate methods don't have access to the file system in sandboxed applications. This would be a problem for the aforementioned case.
Eager to learn more about this, I decided to try sandboxing the app to see what happens. I enabled entitlements and sandboxing for the build target in Xcode and then created a self-signed certificate for code signing in Keychain Access, following this tutorial. The certificate lives inside my login keychain.
The problem is, the freshly created certificate doesn't appear under the Build Settings -> Code Signing -> Code Signing Identity dropdown. The only thing that is there is "3rd Party Mac Developer Application", but the build fails with a code signing issue if that is selected.
Any ideas how I can get it to show up?
I just ran into the same issue. After Quitting and restarting Xcode, my own certificate showed up.

Resources