Need help to build a Mac command-line app for App Store or TestFlight

I have a binary that successfully install & run on my Mac, that is build with codesign and pkgbuild with "Developer ID Application" and "Developer ID Installer" identities.

I cannot figure out how to transform this pkg into a distribution package that fits with App Store and TestFlight.

Xcode builds it fine and can run it seemingly, but cannot provide the App Store Distribution option in Organizer after creation of Archive. (Only Custom option.) I probably may not be able to specify properly the build Target as Release (don't know where to specify).

(pkgbuild ->) productbuild -> Transporter is also an option, but don't know how to properly specify the productbuild --component options...

I have a developer program and can generate the Apple developers certificate fine, such as "3rd Party Mac Developer Application/Installer". A pkg codesign'ed by them was rejected by the notarization process.

My application is C and can be started again as New project from Xcode as "MacOS Command-Line Tool", so in other words my question can be said as "how can I organize a MacOS Command-line tool to conform as App Store distribution?"

I am checking documents but so far cannot get the proper document. Any pointing to a document is appreciated.

Answered by szymczyk in 886709022

The Mac App Store might not accept command-line apps. They may require apps to be in a Mac app bundle.

One way to build your app for the Mac App Store is to create a simple Mac GUI app project in Xcode and bundle your command-line app with the GUI app. Use the Process class to run the command-line app. You will have to conform to the App Sandbox guidelines to get approved on the Mac App Store.

Many Mac apps that bundle command-line apps aren't in the Mac App Store because of the App Sandbox restrictions. You might have to distribute your app from your own website.

I would read App Review Guidelines to see if your project meet them, especially, 2.4.5, to begin with if I were you.

Accepted Answer

The Mac App Store might not accept command-line apps. They may require apps to be in a Mac app bundle.

One way to build your app for the Mac App Store is to create a simple Mac GUI app project in Xcode and bundle your command-line app with the GUI app. Use the Process class to run the command-line app. You will have to conform to the App Sandbox guidelines to get approved on the Mac App Store.

Many Mac apps that bundle command-line apps aren't in the Mac App Store because of the App Sandbox restrictions. You might have to distribute your app from your own website.

I see. After reading 2.4.5 of App Review Guidelines, I've just started to understand that the restrictions of the App Sandbox are sometimes hard to keep. I'm currently seeing a EXC_BREAKPOINT for unknown reasons. But beyond that, my app will have many more upcoming violations on things that App Sandbox or App Store wants to restrict.

"Many Mac apps ... aren't in the Mac App Store because of the App Sandbox restrictions." This is the kind of information that I wanted to get. Thanks.

I think I have to rethink my plans from scratch. In case if you have further suggestions, I describe my intension: my app is a shell-like command-line app that runs on Terminal.app and makes completions on the file names to open. So it's like a system command that scans files in the file system (I know, its a too much freedom for an App...)

Thank you so much, your responses are much appreciated.

Need help to build a Mac command-line app for App Store or TestFlight
 
 
Q