Closed randomPoison closed 7 years ago
Hi @excaliburHisSheath , thanks for this greatly detailed issue! :)
Modifying the Plist seems indeed like the right way to do so: you can use the update_info_plist
action if needed.
For instance, this is how it's used in one of my projects:
update_info_plist(
xcodeproj: xcodeproj,
plist_path: ENV['IOS_PLIST_PATH'],
block: lambda { |plist|
plist['CFBundleIdentifier'] = ENV['IOS_APP_ID']
plist['CFBundleName'] = ENV['IOS_APP_NAME']
plist['CFBundleDisplayName'] = ENV['IOS_APP_NAME']
plist['CFBundleShortVersionString'] = ENV['IOS_VERSION']
plist['CFBundleVersion'] = ENV['IOS_VERSION_BUILD_NUMBER']
},
)
Maybe @stalniy, who added the build number feature has more insights?
For now, the only option is to use increment_build_number
or update_info_plist
. I created related issue for cordova-ios
@stalniy @Almouro In that case, I'll try to put together a PR that uses update_info_plist
. When Cordova supports specifying CFBundleVersion
via the command line, fastlane-plugin-cordova should switch to using that.
sounds good to me :+1:
When I have the action
cordova(platform: "ios", build_number: 123)
in myFastfile
, it calls the Cordova command line tool with the following arguments:fastlane-plugin-cordova
appears to be passing the build number via a--CFBundleVersion
argument tocordova build ios
, however, according to the docs forcordova build ios
and the platform docs for iOS, there's no such flag. In practice, the build number that I give tofastlane-plugin-cordova
does nothing on iOS (though it works as expected for Android, yay).From what I can tell, the only way Cordova supports of specifying the bundle version on iOS is via the
ios-CFBundleVersion
attribute in Config.xml. I tested it out, and I can confirm that setting theios-CFBundleVersion
in Config.xml correctly sets the bundle version for the build, even when usingfastlane-plugin-cordova
.If you want
fastlane-plugin-cordova
to support overriding the build number (which would be useful to me for the purpose of build automation), then the "right" way of doing it would probably be to manually modify the value of theCFBundleVersion
key in thePROJECT-Info.plist
file in the generated Xcode project. It would also work to temporarily modify the project'sConfig.xml
to add/modify theios-CFBundleVersion
attribute, but it seems like bad form to silently modify project's configuration file.If anyone has any thoughts on this, please let me know. If modifying
Info.plist
sounds like the right approach, I can work on putting together a PR that fixes the functionality.