概要
「info.plist」の設定値を「config.xml」から指定できるようになります
「cordova-custom-config」を利用します
基本的にはこちらに書いてある通り
https://github.com/dpa99c/cordova-custom-config
プラグインの導入
$ cordova plugin add cordova-custom-config --fetch --save
使い方
config.xmlの編集
今回は「info.plist」の「Localization」を「config.xml」から指定します
<platform name="ios">
[その他のiosの設定がずらずら]
<config-file parent="CFBundleLocalizations" platform="ios" target="*-Info.plist">
<array>
<string>en</string>
<string>ja</string>
</array>
</config-file>
</platform>
parentの値、stringの値は、実際に「info.plist」ファイルをテキストエディタで確認して指定
ビルドを実行すれば「info.plist」に反映される
$ cordova build ios
反映された「info.plist」の一部
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>ja</string>
</array>
その他
「config.xml」ファイルは各 platform ごとに生成される
[プロジェクト名]/platforms/ios/[プロジェクト名]/config.xml
ちなみにplistは
[プロジェクト名]/platforms/ios/[プロジェクト名]/[プロジェクト名]-Info.plist