0

Is there a way to change the build setting defaults in XCode 7.1 so that every time a project is re-built from an outside source (Meteor/Cordova in this case, but I assume this would be a general issue), it isn't necessary to manually go back through and change all of the XCode build settings to the same values that you'd previously set them to?

Alternatively, is there a way to save all of the settings to a setup file (not to the project itself, since this is recreated from fresh each time).

Thanks

user2330237
  • 1,629
  • 5
  • 20
  • 39

2 Answers2

1

Depending on what you want to set, you could use plistbuddy (a command line tool that you should already have on your system) to set values in the application's plist files.

Here's an example I have used in the past to configure app transport security, but the tool could set any plist data:

/usr/libexec/plistbuddy -c "add NSAppTransportSecurity:NSExceptionDomains:myserver.mydomain.com:NSTemporaryExceptionAllowsInsecureHTTPLoads bool true" platforms/ios/HelloCordova/HelloCordova-Info.plist

Which would add a structure like this to the plist:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
      <key>myserver.mydomain.com</key>
      <dict>
        <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
        <true/>
    </dict>
  </dict>
</dict>

You could potentially use this to set what you need, in combination with the config.xml settings for iOS that Cordova provides, and use Cordova hooks to set these on build or after platform add or whenever you want during your build process.

Simon Prickett
  • 3,838
  • 1
  • 13
  • 26
1

All the build settings are stored in project.pbxproj file. If you want to set things in it, you can simply use awk and sed to modify the fields like DevelopmentTeam, PRODUCE_BUNDLE_IDENTIFIER etc.

Refer to Changing the Team setting of an iOS project at build time and Xcode 7: changing product bundle identifier for further reference.

Community
  • 1
  • 1
Sarthak Singhal
  • 665
  • 2
  • 10
  • 26