|
|
#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. Regards Mark |
|
|
|
0
|
|
|
#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:
Code:
./myAppName argument |
|
|
|
0
|
|
|
#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: export PATH=$PATH:absolutePathnameOfDirectoryWhereYourExecutableIs |
|
|
|
0
|
|
|
#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. Thanks again. Regards Mark |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 11:09 PM.






Linear Mode
