Re: Odd (?) Question - A Mixture Of Experienced And New. Put "Command Line" Application On Desktop?

 



On Jan 19, 2020, at 3:04 PM, Charles Phillips <phillipstriples@...> wrote:

After reading all of this and digesting a bit of it…

The thread almost immediately went astray, but I hope at least some of it was helpful.

Though it is convenient to run them from a shortcut on the desktop, when I do that I drag the executable icon to the desktop. It gives me a shortcut.

Ah, I see. If you want the original executable you can right-click the item and choose "Show In Finder"; this will open the actual build directory containing the binary. You can move or copy that.

Yes. I usually process several sets of data (orbital information for a satellite calculated on many days, the orbits change) and look at the results to see if I picked the right input data. The hard coded paths work well for this task.

It just occurred to me that an easier solution would be to run your tool from the command line (which is the expected way.) Then you can pass it file paths as command-line arguments, which your main() function can read from argv[]. This is as easy as

1. Open Terminal
2. Drag the executable from Xcode to the Terminal window; that will enter its path on the command line
3. Drag the file you want to process to the Terminal window; that will enter _its_ path, as an argument
4. Activate the Terminal window and hit Return.

(There are various shell techniques you can use to simplify that, like adding the executable to the shell's search path.)

—Jens

Join xcode@apple-dev.groups.io to automatically receive all group messages.