Xcode 7.2 build settings for ionic app keep gettin

2019-09-05 22:40发布

问题:

I'm building a hybrid app with cordova and ionic. I've got the app uploading to the app store which is great for internal testing. The issue I have is that the build settings keep becoming reset, so I have to go look back at the previous build to increment the build number, etc... Is there any way to get the build settings to stick? The image below is the build settings I'm referring to that will become reset if I close xcode and reopen.

回答1:

You have to set this values in your config.xml. To set the version and build number, use:

<widget xmlns="http://www.w3.org/ns/widgets" id="com.example.test" version="1.0" android-versionCode="2" ios-CFBundleVersion="2">

And to set the orientation, use this setting:

<platform name="ios">
        <preference name="Orientation" value="all" />
</platform>

See the doc for more infos: http://cordova.apache.org/docs/en/dev/config_ref/index.html