title: Add files to Xcode project through command line ? Use of project.pbxproj file in Xcode?
body: <p>I was trying to add a plist file to a xcode project through command line, some of the blogs suggested to edit the <code>project.pbxproj</code> file. I searched about the <code>project.pbxproj</code> file but was not able to get much information about it. Can anyone let me know what is use of the <code>project.pbxproj</code> file in xcode? How does one add entries to it? </p>
  
  <p>I am using <a href="https://github.com/kronenthaler/mod-pbxproj" rel="noreferrer">this repo</a> to work with it.  </p>
  
  <p>the script that I wrote is as follows:</p>
  
  <pre><code>import sys
  import os
  from mod_pbxproj import XcodeProject
  
  
  def addPlistInProject(corodova_proj_name, xcode_proj_name, plist_file_name):
      print "Cordova project name : " + corodova_proj_name
      present_directory = os.getcwd()
      path_to_xcode_proj = present_directory + '/' + corodova_proj_name + '/platforms/ios/' + xcode_proj_name + '.xcodeproj/project.pbxproj'
      print "Xcode Project Path : " + path_to_xcode_proj
      project = XcodeProject.Load(path_to_xcode_proj)
      project.get_or_create_group('new group')
      project.add_file(plist_file_name)
  
  
  if __name__ == "__main__":
      corodova_proj_name = sys.argv[1]
      xcode_proj_name = sys.argv[2]
      plist_file_name = sys.argv[3]
      print "Xcode Project Name = : " + xcode_proj_name
      print "Plist File Path = : " + plist_file_name
      addPlistInProject(corodova_proj_name, xcode_proj_name, plist_file_name)
  </code></pre>
  
  <p>I will be invoking the script as:</p>
  
  <pre><code>python myscript.py hello HelloWorld manisha-rules_camdo.plist
  </code></pre>
  
  <p><code>myscript.py</code> is the script I wrote, <code>hello</code> is the existing cordova project and <code>HelloWorld</code> is the Xcode project created by using <code>cordova platform add iOS</code>.</p>
  
  <p>The command Sequence I will be following will be as follows: </p>
  
  <pre><code>cordova create hello com.example.hello HelloWorld
  cordova platform add iOS
  py myscript.py hello HelloWorld manisha-rules_camdo.plist
  </code></pre>
  
  <p>Where <code>hello</code> is the name of cordova project and <code>HelloWorld</code> name of iOS target.</p>