running an app with a switch

gphillipk

Registered
I'm trying to run a particular application from Terminal and I have to specify a switch. E.g.: ./hansa-server --maildebug where hansa-server is the name of the app and --maildebug is the switch. The prolem that I encounter is I get an error message that the app specified is a directory. How do I get round this problem?
 
I am maybe just guessing but perhaps try going into your applications folder and control clicking on the application your trying to use and select "Show Package Contents" then go into the folder "Contents" then to "MacOS" There you will find the actual application. Then you can drag the application into your terminal window to get the file path.

So instead of the file path being /Applications/hansa-server it would be /Applications/hansa-server/Contents/MacOS/hansa-server

Hope this works.
 
tried that, but the app. in question requires certain resources that're located in the main folder. Therefore it crashes whenever I try that.
 
You may need to make the 'app' executable.

chmod 777 (while extreme) will do that for you.

Do a man chmod in terminal for more information.
 
It shouldn't matter that the application needs stuff from the main folder. That's true of lots of applications, but you can still use the executable in Contents/MacOS from the command line. If it is crashing, try monitoring that in the console log. You can view this using Applications > Utilities > Console. Sometimes it's possible to find the clue there. Note that setting the permissions to 777 isn't necessarily a guarantee - some applications will abort if the permissions are too permissive as a security measure. Not knowing what this application is, it's a bit hard to say more in this case.
- cfr
 
Back
Top