How to use plist.build:
221 222 223 224 225 226 227 228 229
} handleOrientationSettings(platformConfig, infoPlist); updateProjectPlistForLaunchStoryboard(platformConfig, infoPlist); var info_contents = plist.build(infoPlist); info_contents = info_contents.replace(/<string>[\s\r\n]*<\/string>/g, '<string></string>'); fs.writeFileSync(plistFile, info_contents, 'utf-8'); events.emit('verbose', 'Wrote out iOS Bundle Identifier "' + pkg + '" and iOS Bundle Version "' + version + '" to ' + plistFile);
How to use plist.parse:
194 195 196 197 198 199 200 201 202 203
var originalName = path.basename(locations.xcodeCordovaProj); // Update package id (bundle id) var plistFile = path.join(locations.xcodeCordovaProj, originalName + '-Info.plist'); var infoPlist = plist.parse(fs.readFileSync(plistFile, 'utf8')); infoPlist['CFBundleIdentifier'] = pkg; // Update version (bundle version) infoPlist['CFBundleShortVersionString'] = version;