目录
cocoapods
1. CocoaPods was not able to update the master
repo. If this is an unexpected issue and persists you can inspect it running pod repo update --verbose
今天在更新本地pod库的时候报了这个错,执行pod repo update
和pod install --repo-update
都是报这个错,后来发现是镜像的问题
$ gem sources -l
看到是
*** CURRENT SOURCES ***
https://rubygems.org/
果断换成国内的,操作如下:
先移除
$ gem sources --remove https://rubygems.org/
添加
$ gem sources --add https://gems.ruby-china.com/
再执行$ pod update
发现成功了
Xcode配置
1.修改APP默认配置语言 DEVELOPMENT_LANGUAGE
原xcode里没有设置语言,所以APP上架上看到是显示英文
找到info.plist的Localization Native Development Region,下拉选择China
找到项目的.xcodeproj
这个文件,鼠标右键菜单,打开显示包内容
看到包内容后,有一个文件叫project.pbxproj
,使用广西编辑器打开
全局搜索developmentRegion
,即可找到,en
修改为zh-Hans
,这里是修改为中文简体
再打开project
--> info
--> Localizations
,就可以看到已经把默认的英文配置修改为中文了
2. 模拟器运行报错 dyld: Library not loaded: /usr/lib/libauto.dylib
出错原因是项目在Xcode10.2上创建的,然后运行iOS10以下的模拟器上,Xcode10.2 + iOS9.3之前的版本都会出现这个问题,项目中有swift
相关代码或混编,纯OC无此问题
解决办法:
sudo mkdir ‘/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 9.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift’
根据自己模拟器版本号修改 ,此处是9.0的模拟器 苹果官网问题出处
SourceTree
忽略不必要提交的文件
每次运行项目但并没有修改文件,而SourceTree上都会有那几个文件提示修改了,而这部分文件是不需要提交的,例如UserInterfaceState.xcuserstate
、Breakpoints_v2.xcbkptlist
等
在工具目录下配置.gitgnore
,注意路径如下
输入如下命令,如果未创建,则会创建一个新的.gitignore
文件
$ vim .gitignore
直接按键盘i
,进入编辑模式,拷贝下面内容,最后一条是自己绝对路径,直接拖进来的
*.xcuserstate
project.xcworkspace
xcuserdata
UserInterfaceState.xcuserstate
project.xcworkspace/
xcuserdata/
UserInterface.xcuserstate
gxsz/gxsz.xcworkspace/xcuserdata/letar.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
完成后,:wq
保存退出
删除并提交,Breakpoints_v2.xcbkptlist
和Breakpoints_v2.xcbkptlist
这两个需要执行下面命令
$ git rm --cached future/future.xcworkspace/xcuserdata/letar.xcuserdatad/UserInterfaceState.xcuserstate
$ git commit -m “忽略不必要文件”
$ git push
然后在SourceTree里,提交推送.gitignore
,即可