Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

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