XCode: add build phase is disabled

大憨熊 提交于 2021-02-06 07:56:44

问题


I want to add Crashlytics plugin to my iOS project that demands to add Run script phase. But no matter what I do - for add build phase all options are disabled:

enter image description here

  • I select Target -> Build Phases
  • I have proper scheme
  • My project runs well - no issues,

I run Xcode 6


回答1:


I answer on my question because took me time to find right solution.

Its really strange that the same issue migrates from old versions to XCode 7+. I found solution in one of the comments of similar problem:

how-to-add-a-copy-files-build-phase-to-my-target (credits to @Paul Solt)

Its a bug, when user selects Build Pahses tab, XCode doesn't see that.

Solution

  • select Target -> Build Phases
  • After, click on any area under search form or better way, just open Target Dependencies drop down
  • Editor -> Add Build Phase

I hope it will save time to someone instead to read comments ;)




回答2:


The upvoted solution did not work for me but there is another - even though the "Editor->Add Build Phase" is grayed out the small "+" in the top left of the "Build Phases" pane is not, and it works.

So select the project in the project navigator Select the target Select "Build Phases" in the top bar of the content pane Click the "+" symbol in the top left of the "Build Phases" pane




回答3:


Maxims answer did not work for me.

I had the same problem and solved it as follows and I opened a bug against apple: issue 22516266 on https://bugreport.apple.com

Here is how I solved the issue for me:

1.) Edit Scheme ...

2.) In the relevant phase of the schema you can add scripts as Pre-Actions or Post-Action, where you will find "New Run Script Action"

I think you pretty much create any workflow you like with this.

Hope that helps.



来源:https://stackoverflow.com/questions/25923635/xcode-add-build-phase-is-disabled

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!