最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【部分解决】通过下载和安装使用Xcode9避免Xcode8索引和编译极其慢的问题

Xcode crifan 2888浏览 0评论

折腾:

【部分解决】Xcode的CPU占用率长期超过100%+建立索引和编译极其慢

实在没有其他办法了,包括即使看到说是Xcode 9beta中仍然有这个问题:

Xcode 8 Stuck at Indexing and uses up all free … | Apple Developer Forums

但是没有其他办法了,所以还是只能去试试:

算了,去下载据说解决了问题的Xcode 9吧:

Download – Apple Developer

Xcode 9 GM seed

Includes the latest beta macOS, iOS, watchOS, and tvOS SDKs.

Release Notes

9A235

Sep 12, 2017

https://download.developer.apple.com/Developer_Tools/Xcode_9_GM_seed_build_9A235/Xcode_9_GM_seed.xip

解压都解压了好一会:

然后直接拖动到应用程序,替换之前的Xcode8

重新去打开一个

.xcodeproj

然后首次打开项目开始建立索引indexing

此处, indexing期间的CPU占用率,虽然高,但是也只是80%左右

和之前动辄100%多,好多了。

然后再去clean一下,重新build,结果出现另外的错误:

【已解决】Xcode9中报错:Module compiled with Swift 3.1 cannot be imported in Swift 3.2

结果,编译没问题,但是链接又出错了:

【已解决】Xcode9链接出错:ChartsRealm.framework ChartsRealm compiled with older version of Swift language 3.0 than previous files 4.0 file

然后再去试试,能否解决index和build的慢的问题。

然后的确解决了indexing和build的慢的问题:

新写了函数加了几行代码后,可以立刻检测到函数了:

【总结】

通过下载和使用Xcode9,并且解决了一系列的Carthage引用第三方库的问题后,Xcode9中,indexing建立索引和build编译的速度,就正常了。

尤其是:

切换文件

编辑文件,写新的代码

可以立即,incremental的build,不是全部build,速度正常很快就可以建立好新的索引,代码就可以高亮了。

【后记 2017-09-22】

最近几天的使用发现:

大部分时间,Xcode9的index和build都是很正常的。

但是还是时不时的出现,index和build,占用资源很高的情况,比如:

CPU占用率达到200%甚至300%:

或者是部分文件的index索引失败,文件无法高亮。

所以还是Xcode9有时候有问题,并没有彻底解决问题。

xcode 9 indexing

What’s New in Xcode 9

“Updated the indexing engine to include the ability to index files as they are compiled.”

ios – Why Xcode 9 beta does not show index options for CoreData entities and attributes? – Stack Overflow

Xcode 9 GM indexing for so long…:iOSProgramming

别人也是遇到和此处类似问题:

Xcode8.3左右就有此问题

升级到Xcode9 GM后,问题依旧。

最近刚发布iOS11,以为Xcode9有正式版,结果去:

https://developer.apple.com/download/

好像是看到了Xcode9正式版:

Xcode 9

Sep 19, 2017

9A235

但是此处Xcode9已经是:

Version 9.0 (9A235)

了。。。

【后记 2017-09-29】

无意间看到,27号刚发布了个Xcode 9.1

https://developer.apple.com/download/more/?=Xcode

Download – Apple Developer

其中的

release-notes

写了具体的更新,但是没看到,关于rebuild build index慢的问题。。。

所以,还是没有解决此问题。

转载请注明:在路上 » 【部分解决】通过下载和安装使用Xcode9避免Xcode8索引和编译极其慢的问题

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.176 seconds, using 22.12MB memory