Questions tagged [xcodeproj]

Xcodeproj is a Ruby gem from the makers of CocoaPods that allows scripted access to Xcode's project file.

The Xcodeproj project is a Ruby gem from the makers of CocoaPods that allows scripted access to Xcode's project file.

Installation is as simple as:

gem install xcodeproj

Docs: http://www.rubydoc.info/gems/xcodeproj/

64 questions
32
votes
2 answers

Add run script build phase to Xcode project from podspec

I'm trying to write Cocoapods specification for my library which must modify Xcode project and add "Run Script Build Phase" to project's target. I thought I can use post_install hook. But "pod spec lint" says that this hook is deprecated: - WARN |…
opedge
  • 1,532
  • 1
  • 10
  • 22
30
votes
2 answers

What's the difference between Xcode's move to trash and remove reference?

When I want to delete file in Xcode. Between "move to trash" and "remove reference" which one should I choose? I always choose move to trash before cause I thought it will definitely delete the real file. But not sure if that's right. So what is the…
itenyh
  • 1,921
  • 2
  • 23
  • 38
21
votes
3 answers

How to fix -resources.sh: line 7: realpath: command not found in Xcode

I'm setting up a new project with pods. Where do I need to set the path for below error -resources.sh: line 7: realpath: command not found
balusu
  • 367
  • 3
  • 10
13
votes
3 answers

App Sandbox capability missing in Xcode project

According to this guide, there should be an App Sandbox capability in the project file: However, for some reason my app project does not have any App Sandbox capability that I can turn on: Why is it missing, and how can I get it there?
inhwrbp
  • 569
  • 2
  • 4
  • 17
7
votes
1 answer

Xcode 12.4 crashes when opening any project

Xcode keeps crashing whenever I try to run any .xcodeproj or .xcworkspace project. Solutions I've tried are: reinstalling Xcode, deleting derived data, and deleting xcuserstate folder. Xcode keeps failing with the below error: Process: …
Tochukwu
  • 190
  • 1
  • 11
7
votes
2 answers

XCode project: how to remove / add files from terminal (script, command, etc)

Is there a way to remove files from or add files to a XCode project without using XCode? That is, is there any terminal command or program to do it? I know I can do cp mv and rm to add / remove files but they are not reflected in the actual project…
hzxu
  • 5,753
  • 11
  • 60
  • 95
5
votes
1 answer

What is a proper way to execute ruby script from xcode build phase script?

I wrote some ruby script, that uses CocoaPods/Xcodeproj to edit xcode project file. This script executes from xcode build phase script: ruby script.rb someProj.xcodeproj Inside ruby script, there is a 'require' for xcodeproj: require…
Nikita
  • 1,811
  • 1
  • 20
  • 41
4
votes
1 answer

Cocoapods post_install, how to add target membership in Pods project

I have a Podfile, that when constructing the Pods.xcodeProj ends up with an included xcframework that is a Pods.xcodeproj file reference, that I need to add as a target reference to one of the pods built targets. I think it's possible to do such a…
Kendall Helmstetter Gelner
  • 74,769
  • 26
  • 128
  • 150
4
votes
2 answers

Ruby script (xcodeproj) to add all source files to a target

I'm trying to run a playground in my project. The problem being that the project contains thousands of files that are tightly coupled. I've created a cocoa touch framework that I can import to utilize the apps source in the playground. The only…
Alex Bollbach
  • 4,370
  • 9
  • 32
  • 80
4
votes
2 answers

Hook in Podfile to edit my project file

I want to fix Cocoapods bug, when it adds Embed Pods Frameworks build phase for Extension targets. These phases are not needed there. https://github.com/CocoaPods/CocoaPods/issues/4203 I wrote script to remove it puts "Deleting not needed…
Gleb Tarasov
  • 885
  • 11
  • 15
3
votes
0 answers

Add Active Compilation Conditions/Custom Flags using fastlane

I need to add / remove preprocessor macros dynamically through fastlane. I'm able to add custom values into custom fields (User Defined) but I couldn't add any flags into Active Compilation Conditions. Here is my related lane -> fastlane_version…
emrcftci
  • 3,355
  • 3
  • 21
  • 35
3
votes
1 answer

Script to Remove files from Xcodeproj

I need to remove the reference to some files from my Xcode project from command line. I'm trying with the ruby lib Xcodeproj, but I can't understand how to do it: proj = Xcodeproj::Project.open(project_file) proj.targets.each do |target| path =…
3
votes
2 answers

When Xcode opens the last project on launch it's listed in red with no files

When I open Xcode it automatically opens the last projects that were open when it quit. I have one .xcodeproj that gets displayed in red in the Project navigator and there are no files visible for the project. I am not able to compile the…
runmad
  • 14,846
  • 9
  • 99
  • 140
3
votes
1 answer

access parent project OTHER_SWIFT_FLAGS from pod

Building a custom pod for a private framework, in my main project i use custom OTHER_SWIFT_FLAGS. In theory it should be possible to override the settings of the pod during the install based on the main project but there is no documentation on how…
thibaut noah
  • 1,474
  • 2
  • 11
  • 39
3
votes
1 answer

How to remove a group from Xcode project programmatically?

I need to manage an Xcode project from a batch process, partially remove certain groups. As I understand, the only tool is xcodeproj. Or writing own pbxproj file parser. So I have installed xcodeproj. First of all, there is no reasonable…
Nikita
  • 1,811
  • 1
  • 20
  • 41
1
2 3 4 5