如何在命令行实用程序中获取不同版本的XCode的路径?
我已经安装了 XCode 版本 3.2、4.2 和 5.0,并且它已经在 MAC 的根目录中创建了目录结构,如下所示
## Root ## - /Developer - /Developer42 - /Developer50
现在当我检查我的环境变量 PATH
时,它将显示 /Developer50< /code>
但是当我使用 iPhoneSim 和 WaxSim 我只将 /Developer
作为我的路径。
在 WaxSim 中,它们是环境变量的参数,但是我应该在其中提供哪个路径?如果这不是正确的方法,那么如何设置 XCode 的任何开发人员目录的路径?
我只想运行我的应用程序文件而不启动XCode并使用自定义iPhone/模拟器和自定义SDK。
为此,我还参考了 http://oreilly.com /iphone/excerpts/iphone-sdk/getting-started-iphone-sdk.html
这里我参考了 PROTOTYPE 部分和构建应用程序部分。
感谢您的帮助...
编辑 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
编辑 2 对于 WaxSim,我使用以下命令。那么这有什么问题吗?我无法获取 /Developer50
路径
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
打开 Terminal.app 并输入以下内容:
将
/Developer:/Developer42:/Developer50
替换/添加为/Developer/usr/bin:/Developer42/usr/bin:/Developer50/usr /bin
,添加您想要在PATH
中的每个路径,并用:
分隔。然后输入:来获取文件。重新启动任何需要使用
PATH
的打开程序/shell,当您下次运行它们时,它们将具有更新的路径。Open up Terminal.app and type this:
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 yourPATH
, seperated by a:
. Then type: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.好的@chrown 感谢您的帮助。
我发现这些实用程序使用构建设置中给出的静态路径,因此我删除了这些实用程序的其他链接器标志并再次编译。
现在我必须在环境变量中设置这些链接器标志的路径。所以我使用了下面的命令。
然后我使用 xcode-select -switch 命令来切换我的 Xcode 版本,这就是我所要做的...实用程序本身将处理路径..
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.
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..