Re: PATH for applications run inside XCode
Re: PATH for applications run inside XCode
- Subject: Re: PATH for applications run inside XCode
- From: Jens Alfke <email@hidden>
- Date: Fri, 24 Apr 2015 10:26:37 -0700
On Apr 24, 2015, at 2:29 AM, Jon Hodgson < email@hidden> wrote:
I can work around this issue, but it does beg the question, is there a way to ensure that a program run inside XCode will see the same PATH (and ideally other environment variables) as it would see when run from the command line?
I’ve run into this before — I wrote a Mercurial client app that needed to find the ‘hg’ tool in the user’s $PATH. It’s surprisingly hard to solve. The root of the problem is that apps aren’t launched from a shell, so they don’t inherit any environment variables set during shell initialization.
I just noticed that you’re probably writing a command line tool (if that’s what you mean by “console app”) — I’m talking about GUI apps, but the same is true for a command-line tool when it’s launched from Xcode.
In your case, I agree with Scott that it’s easiest just to go into the Xcode scheme editor and set the necessary environment variables there, since the problem won’t occur in normal usage. The in-app workarounds are considerably more involved (but I can describe them if you want to know!)
—Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden