Mac App Store -- Submitting Command Line Tool Application

Is it possible to distribute a command line application to the Mac App Store?


I suspect not, because when you create an OS X Application "Command Line Tool" project in Xcode, it doesn't have the General tab where you can specify Mac App Store code signing (like you do when you do a regular Cocoa Application.


Does anyone know what other options are available for distribution other than your own site? Is it possible to bundle a Command Line Tool in along with a regular Cocoa Application and submit that to the Mac App Store -- that would be a nice option.


Thanks,

Grant X

Accepted Reply

Is it possible to distribute a command line application to the Mac App Store?

No. It’s call the Mac App Store for a reason (-

Is it possible to bundle a Command Line Tool in along with a regular Cocoa Application and submit that to the Mac App Store …

You can include a common line tool within a Mac App Store app, and lots of apps use this technique for helper tools, but things get tricky if you want to expose that tool to users. The specific gotcha is sandboxing. Command line tools within a Mac App Store app must use an inherited sandbox (

com.apple.security.inherit
). However, such tools cannot be executed from Terminal because there’s no sandbox to inherit.

You can work around this by bundling your command line tool into a helper app and applying app-style sandboxing to that. The problem here is that your code will then run inside an app sandbox, which can cause all sorts of problems (for example, if the user supplies a path as a command line argument, the sandbox might block your access to that path).

What sort of tool are you trying to ship? There may be a way around this problem but the best approach depends on the overall shape of your product.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

Is it possible to distribute a command line application to the Mac App Store?

No. It’s call the Mac App Store for a reason (-

Is it possible to bundle a Command Line Tool in along with a regular Cocoa Application and submit that to the Mac App Store …

You can include a common line tool within a Mac App Store app, and lots of apps use this technique for helper tools, but things get tricky if you want to expose that tool to users. The specific gotcha is sandboxing. Command line tools within a Mac App Store app must use an inherited sandbox (

com.apple.security.inherit
). However, such tools cannot be executed from Terminal because there’s no sandbox to inherit.

You can work around this by bundling your command line tool into a helper app and applying app-style sandboxing to that. The problem here is that your code will then run inside an app sandbox, which can cause all sorts of problems (for example, if the user supplies a path as a command line argument, the sandbox might block your access to that path).

What sort of tool are you trying to ship? There may be a way around this problem but the best approach depends on the overall shape of your product.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Quinn,


I've developed something for my own use and would love to share it. Might need to look at homebrew or something like that. It's a pretty basic command line application that facilitates copying and pasting to the clipboard ... but not just what pbcopy and pbpaste do. It allows you to copy/paste files so that you don't have to open the Finder in order to do a drag/drop. Based on what you've told me, sandboxing isn't going to allow the application to work as intended.


Thanks for the reply. I appreciate the feedback. You've pretty much confirmed my expectations.


Regards,

Grant

I've developed something for my own use and would love to share it. Might need to look at homebrew or something like that.

That’s certainly one option. You can also distribute a binary yourself, taking advantage of the Developer ID programme.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"