Skip to content

Instantly share code, notes, and snippets.

@larryaasen
Created February 26, 2013 02:29
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larryaasen/5035313 to your computer and use it in GitHub Desktop.
Save larryaasen/5035313 to your computer and use it in GitHub Desktop.
Using the Xcodeproj Ruby Gem - open exising Xcode project, add a file to the project in the main group, add the file to the main target, and save the Xcode project file.
# Open the existing Xcode project
project_file = product_name + '.xcodeproj'
project = Xcodeproj::Project.new(project_file)
# Add a file to the project in the main group
file_name = 'Message.m'
group_name = product_name
file = project.new_file(file_name, group_name)
# Add the file to the main target
main_target = project.targets.first
main_target.add_file_references([file])
# Save the project file
project.save_as(project_file)
@lolgear
Copy link

lolgear commented Feb 25, 2014

Hi! How can I list all files/frameworks that were added to existed project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment