Last active
July 5, 2016 19:57
-
-
Save akofman/b53124f76ec309160e08 to your computer and use it in GitHub Desktop.
Cordova hook to disable bitcode for ios9 projects.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/* | |
* Disable bitcode for ios9 projects. | |
* versions: | |
* xcode 0.8.2 | |
* cordova-lib 5.3.3 | |
*/ | |
var xcode = require('xcode'); | |
var fs = require('fs'); | |
var util = require('cordova-lib/src/cordova/util'); | |
var ConfigParser = require('cordova-lib/src/configparser/ConfigParser'); | |
var projectName = new ConfigParser(util.projectConfig(util.isCordova())).name(); | |
var projectPath = './platforms/ios/' + projectName + '.xcodeproj/project.pbxproj'; | |
var myProj = xcode.project(projectPath); | |
myProj.parse(function (err) { | |
if(err){ | |
console.log('Error: ' + JSON.stringify(err)); | |
} | |
else{ | |
myProj.updateBuildProperty('ENABLE_BITCODE', 'NO'); | |
fs.writeFileSync(projectPath, myProj.writeSync()); | |
console.log('✔ BITCODE disable'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're welcome ! I also write a plugin version if you prefer not to copy/paste this hook for all your projects :
https://github.com/akofman/cordova-plugin-disable-bitcode