Skip to content

Instantly share code, notes, and snippets.

Last active May 16, 2023 07:07
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Ruby script that uses cocoapods Xcodeproj to set development_region / known_regions of an Xcode project to German
#!/usr/bin/env ruby
require 'fileutils'
require 'xcodeproj'
unless ARGV.count == 2
puts "Usage: xcode_set_development_region.rb [project] [region]"
filename = ARGV[0]
region = ARGV[1]
raise "Argument '#{filename}' is not a valid .xcodeproject" unless filename && && File.extname(filename).downcase == ".xcodeproj"
puts "Region to set: "
project =
project.root_object.development_region = region
puts "#{project.path}", "development_region = #{project.root_object.development_region}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment