黑色大字体是在之前作者基础上做的修改,仅供参考.
由于需要现在要更改包名,但是在网上找了N多资料都比较老,16年的资料却是残缺不全,尤其 ios10 出了 .entitlement 的机制 ,很多琐碎的小细节 很容易忘记。所以我自己总结了一篇, 环境为 Xcode Version 9.0 (9A235)。
注意:请在修改前使用git 备份工程,如果使用的SVN 要把 代码从仓库拖出来修改。
1,修改文件名(将bubble 修改成bubblewrap)
----->


点击"bubble"文件夹进入,把和"bubble"一样的蓝色文件修改成"bubblewrap"
2, 将旧项目文件夹和Tests文件夹还有UITest文件夹修改为新的名称,修改后如下图所示(我这里没有UITests,)
(注意:UITests和Tests要不要动,只修改前面的bubble,而且要把里面的.m文件名也修改)


3,右击你的项目.xcodeproj,选择“show content package”(中文:显示包内容),看到如下目录,并将project.pbxproj文件以文本编辑打开。


4,替换新旧项目名:按command+f(这主要是修改项目文件路径等)

勾选 替换 ,点击全部
5,进入项目,修改项目名(注意:如果使用的是cocopods,从 你的项目.xcworkspace 进入)
按回车 修改 bubble-->bubblewrap(如果打开工程后发现,工程文件变红了,也就是丢失了,参考直接跳到本文末,有解决方法)


点 rename
6,修改schemess

回车修改 bubble --->bubblewrap,点击close
(此处可以先取消,然后点击左下角"-"号,先去掉,再点击"+"号,添加新改动名字工程)

7,修改Tests 和UITests文件(将interface 和implementation 后的bubble 修改为 bubblewarp )

8,修改 cocopods 的Podfile文件(注意,我没有UITests,所以如果你有,那么你修改三次)

9,修改旧项目的Tests及UITests文件名和cocoapods启动项及项目启动项
bubble.xcworkspace---->bubblewrap.xcworkspace
bubble.xcodeproj---->bubblewrap.xcodeproj

结束!
最后的最后:
错误1:The file “bubble.entitlements” couldn’t be opened because there is no such file.
这是 ios 10 出的签名机制,想了解更多参考 http://www.cnblogs.com/abinzhang/p/5662061.html,解决方式就是 删除报红的 bubble.entitlements 文件,然后在build Setting 中清空签名文件,在清除下Xcode 缓存编译,解决!


错误2:diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory error: The sandbox is not in sync with the Podfile.lock.
Run 'pod install' or update your CocoaPods installation.
执行 8 ,然后 在终端 CD到项目 执行 pod install,如果还是报错,请参考 http://www.jianshu.com/p/4c3164fe552a
我 执行pod install ,报错[!] Unable to find a target named `bubblewrap`, did find `bubblewrapwrap` and `bubblewrapwrapTests`.
并且我的cocopods文件全都丢失了如下图


这个错误说明我的cocopods 和工程捆绑有问题,于是我查看我的 Podfile 文件,发现没有问题,并没有出现
bubblewrapwarp 和 bubblewrapwarpTests
如下图

然后 我再次按照3和4 的步骤查找了bubblewrapwarp 发现了 18 处,所以我将bubblewrapwarp替换成bubblewrap,解决

错误3:xxxTests.m文件和xxxUITests.m文件是不可用的
执行 2,和7 ,解决
错误4:
如果执行 5 的时候发现下面的情况是因为,提前执行了本文中的9 步骤。

解决方法:打开工程 目录,将 .xcodeproj 文件拖到上图位置中,然后点击 New Scheme,在target 选择你的 target(就是带图标那个),name就是你要改的名字。

确定后编译, 如果你修改了Podfile , 那么会报错误2,执行pod install 就可以了
本文参考:http://www.jianshu.com/p/afa14125f66b
http://www.jianshu.com/p/4c3164fe552a
http://www.cnblogs.com/abinzhang/p/5662061.html



0
0
«上一篇:在drawRect:方法中绘制图片,文字以及Core Graphics 框架的了解
»下一篇:dyld: could not load inserted library '/Developer/usr/lib/libBacktraceRecording.dylib' because no suitable image found. Did find:
网友评论