title: xcode change code signing identity by ruby gem xcodeproj
body: <p>I'm totally new to Ruby but managed to change the project based code signing identity and provisioning profile in xcode like so:</p>
  
  <pre><code>#!/usr/bin/env ruby
  
  require 'xcodeproj'
  
  xcproj = Xcodeproj::Project.open("MyProject.xcodeproj")
  
  xcproj.build_configurations.each do |item|
      item.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = "iOS Development: xxxxxx xxxx (xxxxxxxxx)"
  end
  
  xcproj.build_configurations.each do |item|
      item.build_settings['PROVISIONING_PROFILE[sdk=iphoneos*]'] = "628352b1-9b78-xxxx-xxxx-xxxxxxxxx"
  end
  
  xcproj.save
  </code></pre>
  
  <p>My problem is the target based code signing identity and provisioning profile will override the project based one. But I can't find a method to directly set the target based one. Hope someone can help here. Thanks</p>