Forked from ralfebert/xcode_set_development_language_de.rb
Last active
January 20, 2020 13:42
-
-
Save olgusirman/c539046cbe4490ae3eca08f383ef1a9d to your computer and use it in GitHub Desktop.
Ruby script that uses cocoapods Xcodeproj to set development_region / known_regions of an Xcode project to any language
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 ruby | |
require 'fileutils' | |
require 'xcodeproj' | |
unless ARGV.count == 2 | |
puts "Usage: xcode_set_development_region.rb [project] [region]" | |
exit(1) | |
end | |
filename = ARGV[0] | |
region = ARGV[1] | |
raise "Argument '#{filename}' is not a valid .xcodeproject" unless filename && File.directory?(filename) && File.extname(filename).downcase == ".xcodeproj" | |
puts "Region to set: " | |
project = Xcodeproj::Project.open(filename) | |
project.root_object.development_region = region | |
project.save | |
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
ruby setDevelopmentLanguage.rb {yourProjectName}.xcodeproj {yourRegionCode}