|Dec 6, 2012, 12:19 PM||#1|
excecuting a command line tool from Terminal
I have made a command line tool from the project template in Xcode, and have tested it from the IDE and everything is working as it should, the tool requires one argument to excecute, or if no argument is entered it simply returns the version information.
I have made an archive version with a release build. but when I navigate to the excecutable folder in Terminal, and enter the name of the app, the bash shell returns a message saying command not found.
But if I type into the Terminal window "open myAppName" it opens a second teminal window and returns the no argument version info, if I try to use "open myAppName argument" it says that the argument could not be found.
I'm using Xcode 4.52 on OSX 10.7.
Have I missed something in the way you have to build or deploy a command line tool ?
I have never built a command line tool before now, so I have no knowledge
or previous experience with this type of project.
Any help or advise would be much appreciated, Thanks in advance.
|Dec 6, 2012, 01:07 PM||#2|
The "open" command is used to tell the computer to open the application as if you'd double-clicked it in the Finder. That's not really what you want to do. Instead, try invoking the program like this:
|Dec 6, 2012, 01:28 PM||#3|
PATH environment variable
You need to add the absolute pathname of the directory where your executable is to PATH environment variable or copy your executable in one of the listed directories in the PATH environment variable.
You can type in the command line the following to see the list of current directories in the PATH environment variable: echo $PATH
To change the PATH environment variable: vi $HOME/.profile file and add at the bottom of the file the following line:
|Dec 6, 2012, 02:46 PM||#4|
Thanks ytk & peoplevoice.
Yes adding "./" to my Terminal command did indeed run the tool.
I was aware of the $PATH variable to access system wide folders, but as a
UNIX newbie, I did not want to go down the path of changing this setting, just
to test this particular project from the Terminal.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|better touch tool command||anonymous4a||Mac Applications and Mac App Store||0||Mar 11, 2014 10:38 AM|
|command tool for mac osx||syntax.syntax||OS X Mavericks (10.9)||13||Feb 14, 2014 06:09 PM|
|General: iOS7 command line... Equivalent of "say" command?||RobertoG||Jailbreaks and iOS Hacks||0||Jan 19, 2014 05:05 PM|
|Terminal command||andynewfriends||Mac Basics and Help||0||Jun 11, 2013 01:25 PM|
|Need command in terminal||chadteetzen||OS X||1||Jun 8, 2012 10:55 PM|
All times are GMT -5. The time now is 04:03 AM.