iOS修改默认Xcode版本的方法

本文提供了解决Mac系统中安装了多个Xcode版本时,默认使用哪个版本打开工程的问题。通过使用lsregister工具,可以实现修改特定应用的文件关联设置,确保正确打开所需的Xcode版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

电脑中装了二个xcode版本,一个是xcode6-beta,一个是xcode5.1.1,每次打开工程时,默认是用xcode6-beta打开。在简介中修改打开方式也没用,后来在stackoverflow中找到答案

After reading about LaunchServices in OS X I have finally found the solution, thanks for the hint @peter-m.

To modify files association for certain app one can use lsregister tool. So to re-register the app there is-f parameter, and to unregister -u. Everything can be in fact done with just one command:

$ lsregister -f /Applications/Xcode.app

Or if you want to unregister Xcode 5 and not touch manually set associations earlier:

$ lsregister -u /Applications/Xcode5-DP5.app

lsregister is located in /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/, so add it to your $PATH

Re-login to OS X for changes to apply.

 

简言之,就是在终端输入:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -u /Applications/Xcode5.app

然后在简介中修改打开方式就OK了。

转载于:https://www.cnblogs.com/kw-ios/p/3817730.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值