I’m trying to work out a way to identify the executable path of a command line tool in Objective C.
Hence, if the executable is /Applications/Utils/MyTool, then that method would return /Applications/Utils
I’m using the Foundation framework.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m assuming that by
/Applications/Utils/MyTool, you mean an application named “MyTool” in the “Utils” directory within the “Application” directory (which is actually the path/Applications/Utils/MyTools.app). In that case, you could get the directory in which the application resides (/Applications/Utils) with the following bit of code: