Skip to content

Instantly share code, notes, and snippets.

@mahmudahsan
Created November 26, 2017 12:43
Show Gist options
  • Save mahmudahsan/d4803695003573d1c3956b3e49eca319 to your computer and use it in GitHub Desktop.
Save mahmudahsan/d4803695003573d1c3956b3e49eca319 to your computer and use it in GitHub Desktop.
#!/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