使用cocoapods时,更改PRODUCT_NAME的最佳方法是什么? [英] When using cocoapods, what is the best way to change the PRODUCT_NAME?

查看:213
本文介绍了使用cocoapods时,更改PRODUCT_NAME的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个名为ABC的应用。几个月后,我决定将名称更改为ABCD。我相信我改变它的方式,在我的Podfile中,我改变了 targetABCdo targetABCDdo 。然而,我记得在我的工作区中经历了相当多的问题/错误,导致了很多压力。很久以前,我还记不清了。

I created an app with name "ABC". Months later I decided to change the name to "ABCD". I believe the way I changed it, was in my Podfile, I changed target "ABC" do to target "ABCD" do. However, I recall going through quite a few issues/errors afterward in my workspace that caused a lot of stress. It was so long ago that I can't quite recall though.

现在我准备提交,我想最后一次更改名称。我在iTunes Connect中更改了名称,但现在我要更改我的PRODUCT_NAME和我的包标识符以匹配。

Now I'm ready to submit, and I want to change the name one last time. I've changed the name in iTunes Connect, but now I want to change my PRODUCT_NAME, and my bundle identifier to match.

这是最好的方法是什么?我应该更改我的Podfile中的目标字段吗?或者我应该离开他们,只是改变别的东西在Xcode?

What is the best way to do this? Should I change the target fields in my Podfile? Or should I leave them, and just change something else in Xcode? Or do I need to change both or more than one thing?

推荐答案

当你有一个Pod文件时, .xcworkspace Pods.xcodeproj 是由 pod install 进程动态生成的。

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. 更改产品名称

  2. 关闭Xcode中的项目

  3. 舍弃现有的 .xcworkspace Pods 文件夹& Podfile.lock

  4. 再次运行 pod install

  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.

CocoaPods引擎将重新生成其项目,从其缓存中拉出Pods并重新创建其 Pods.xcodeproj

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

这可能会更复杂一些,除了你的主项目和其他依赖项, c $ c> Pods 项目。

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.

这篇关于使用cocoapods时,更改PRODUCT_NAME的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆