简体   繁体   中英

How to get path of Different versions of XCode in command line utility?

I have install XCode Version 3.2, 4.2, and 5.0 and It has created Directory Structure in Root Directory of MAC as follow

## Root ##
 - /Developer
 - /Developer42
 - /Developer50

Now When I will check my Environment Variable PATH , it will show /Developer50

But When I am using Utilities like iPhoneSim and WaxSim I am only getting /Developer as my PATH.

In WaxSim, their is argument for environment Variable, But which path should I provide in that? If this is not proper way then How can I set Path to any Developer Directory for XCode?

I just want to run my app file without launching XCode and with the Custom iPhone/Simulator and Custom SDKs .

For this I had also refer http://oreilly.com/iphone/excerpts/iphone-sdk/getting-started-iphone-sdk.html

Here I have referred to PROTOTYPE section and BUILDING AN APPLICATION section.

thank for any help...

EDIT 1

mac-mini:~ neha$ $PATH
  -bash: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin: No such file or directory
mac-mini:~ neha$ echo "PATH=$PATH:/Developer:/Developer50" >> ~/.bashrc
mac-mini:~ neha$ $PATH
  -bash: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin: No such file or directory
mac-mini:~ neha$ source ~/.bashr
     -bash: /Users/neha/.bashr: No such file or directory

EDIT 2 For WaxSim i am using following command. So what is wrong in this?? I am not able to get /Developer50 path

mac-mini:~ neha$ /DHIREN/waxsim -e PATH="/Developer50/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer50/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" -s 5.0 /DHIREN/TestEnvVar.app
Unknown sdk '5.0'
Available sdks are...
  3.2
  4.0

Open up Terminal.app and type this:

echo "PATH=$PATH:/Developer:/Developer42:/Developer50" >> ~/.bashrc

Replace/Add to /Developer:/Developer42:/Developer50 with /Developer/usr/bin:/Developer42/usr/bin:/Developer50/usr/bin , adding each path that you want to be in your PATH , seperated by a : . Then type:

source ~/.bashrc

to source the file. Restart any open programs/shells that need to use PATH and when you run them the next time they will have the updated paths.

Ok @chrown thanx for your help.

I have found that those utility were using the static path given in Build Settings so I have deleted the Other Linker Flags of those utility and compiled again.

Now I have to set the path for those Linker Flags in my environment variable. So i had used below command.

export LD_LIBRARY_PATH=/<xcode-directory>/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework/Versions/A/

Then I have used xcode-select -switch command to switch my Xcode versions and that was all i have to do... Utility itself will take care of the path..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM