前言
XCode中Argument/Options模块,通过这两个模块,在启动APP的时候传递一些额外的参数进去,覆盖系统的默认值,实现指定条件的调试。
配置路径
Product -> Scheme -> Edit Scheme
Edit Scheme.png
OPTIONS

- Core Location用来模拟APP的位置
- Application Data 用于测试CoreData的Scheme迁移
- Routing App Coverage File 一个GeoJSON文件,对于导航类应用指明APP支持的区域
- Background fetch 启动由background fetch触发
- Show non-localized strings 显示没有本地化的字符串
- Application Language & Application Region 系统的语言和区域
Arguments

Argument Passed On Launch
启动参数,用来覆盖NSUserDefault中的默认值。
注意:启动参数只有在通过XCode启动APP的时候才会起作用,直接点击图标启动是没有用的。
本地化
多语言支持。
同样的文字,在某语言中会显示很长,设置NSDoubleLocalizedStrings预览2倍显示当前字符串的样子。
-NSDoubleLocalizedStrings YES
显示没有本地化的字符串
开启这个参数,运行App,对于没有本地化的字符串,会打印出log,并且在英文环境下,没有本地化的字符串会变成全部是大写的。
-NSShowNonLocalizedStrings YES
网友评论