When using cocoapods, what is the best way to change the PRODUCT_NAME?

﹥>﹥吖頭↗ 提交于 2019-12-03 02:55:06

When you have a Pod file the .xcworkspace and Pods.xcodeproj is generated dynamically by the pod install process.

So one way to deal with this is

  1. Change your product name
  2. Close the project in Xcode
  3. Discard the existing .xcworkspace, Pods folder & Podfile.lock
  4. Run pod install again.

The cocoapods engine will regenerate its project, pull the Pods from its cache and recreate its Pods.xcodeproj with the new project settings.

This might be a little more complex in the case where you have other dependancies besides your main project and the Pods project in your workspace.

You'll probably want to have everything committed to source control before you do this so you can revert if it goes wrong.

Sergey Sahakyan

I solved if for my project with this steps.

  1. I install cocoapods-deintegrate

    [sudo] gem install cocoapods-deintegrate

    and call pod deintegrate on my project.

  2. open XCode, click on project name and click again with delay to rename, follow xcode instructions

  3. run pod install again on your project.

  4. NOTE: if you are just Capitalising, or Uppercassing project name do it with other temp name: for me locdel->aaa->Locdel.

I've been scouting the internet to no avail looking for an answer to this. While editing the podfile and running pod install again fixes the renaming problem, in my case it broke my application as those pods had evolved while my app had stayed the same. If you have concerns about backwards compatibility and don't want to reinstall your dependencies I suggest you do as I did and edit directly the .xcworkspace and .xcodeproj files using a text editor.

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