Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/ruby
#XCode modification
require 'xcodeproj'
bundleId = ARGV[0]
path = ARGV[1]
project_path = path + "/XCodeProject.xcodeproj"
puts(project_path)
project = Xcodeproj::Project.open(project_path)
app = project.targets[0]
wkExApp = project.targets[1]
wkApp = project.targets[2]
puts app.name
puts wkApp.name
puts wkExApp.name
app.build_configurations.each do |config|
config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = bundleId
end
wkApp.build_configurations.each do |config|
config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = bundleId + ".watchkitapp"
end
wkExApp.build_configurations.each do |config|
config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = bundleId + ".watchkitapp.watchkitextension"
end
project::save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment