一,配置多个scheme
第一步 Edit Scheme

第二步,点击manage schemes ,在这步的build configuration 配置 debug release 这样就不用来回替换debug release 了,LoginApp 对应release LoginApp-debug 对应debug。

第三步,左下角点增加直接添加schemes

二,配置不同的xcconfig
第一步,New File ,选择 Configuration settings File

第二步,创建好两个config,每个config配置不同的HOST_URL

在这个config里面配置的key名称可以去 xcodebuildsetting 这个网站 查找对应的key值比如下边的OTHER_LDFLAGS 对应的就是Other Linker Flags

第三步,info里面配置每个scheme的config,这里要提到的是 可以看出有好多选项。
但是我们只能选择一个,当我们用了pod时,我们可以把pod引入 自己的配置config中,看上图 #include "Pods/Target Support Files/Pods-LoginApp/Pods-LoginApp.debug.xcconfig",这样就可以使用了。

在info.plist里面配置HOST_URL


网友评论