Xcodebuild can't find the correct scheme - xcodebuild

I'm trying to build an app using the commandline, however when I use xcodebuild -list it doesn't display the correct scheme, only those my project requires.
I have tried going into Xcode > Manage Schemes and set the correct scheme to "shared" but that doesn't help.
Using Xcode I have no problems building the main project but using Xcodebuild I can only build the dependencies.
Any help will be greatly appreciated.
EDIT:

Related

Using Crashlytics on iOS with CMake

Our projects all use CMake, and Fabric seems to require a script run in XCode's build environment to extract information. CMake doesn't seem to have a way to add a run script build phase.
So, I tried running the script manually after setting the following manually from known values in CMake:
INFOPLIST_PATH
BUILT_PRODUCTS_DIR
DWARF_DSYM_FILE_NAME
DWARF_DSYM_FOLDER_PATH
PROJECT_DIR
As a result, there were no errors when running the script but ..also nothing happened. I just got a "Launching uploader in validation mode" and then the process exited.
Is it possible I could get a full run-down of what the program needs in order to run? Our projects are built on a build server so having to VNC in and launch xcode to build is not really an option.
Thanks in advance.
Since you're using CMake, instead of using the run script build phase, I'd use the upload-symbols script as that will be a more reliable way to upload the dSYMs to Crashlytics.

CocoaPods : cmd-line builds

It seems that in cmd-line builds, Pods don't get built automatically. Even when invoking xcodebuild to reference the workspace that declares how projects link to each other.
Is there a way to fix this, besides manually opening the project in Xcode and building?
I don't have any problem with such configuration: CocoaPods 0.28.0 and Xcode5 (+ Command-Line Tools) here and building using the Command-Line quite often (especially for Continuous Integration) without having any problem.
Neither with the Apple's xcodebuild command, nor with xctool (see also this NSHipster's article) when building my personnal project using Travis-CI either, everything works fine;
At work we have plenty of Xcode workspaces created using CocoaPods / pod install and we use Jenkins-CI to run xcodebuild to build them and no problem either.
Maybe you need to check a bit more about your configuration? Which CocoaPods & Xcode version, Which Command-Line Tools (xcode-select --print-path?), How is you Xcode configured (maybe you changed some of Xcode's default settings that broke it somehow)?
Tell us more about your specific configuration and the error/warning messages you got, because there should not be any problem.
Also make sure you have an up-to-date version of CocoaPods (some stuff were fixed some versions ago regarding Xcode5 and the new arm64 architecture, that broke implicit dependency detection in some cases)

RestKit.h Not Found When Building With Xcode Product > Profile

I have an app that uses RestKit 0.10.2 and I can build and run the app just fine in the Xcode 4.4.1 simulator using iOS 5.1.1. I can also run Analyze without any issues. However, when I go to try and Profile the app, the build fails with Lexical or Preprocessor Issue RestKit/Reskit.h file not found.
Here's what I have in Header Search Paths > Debug on the target:
$(BUILT_PRODUCTS_DIR)/../three20
$(BUILT_PRODUCTS_DIR)/../../three20
"$(BUILT_PRODUCTS_DIR)/../../Headers"
What could I be missing? When I upgraded from 0.94 to 0.10.2 I completely removed Restkit from my project and re-imported it because I was having a lot of issues trying to get this exact same problem resolved for a normal run. Any ideas?
Profile uses a Release build by default, not Debug (since it makes no sense to profile a debug build). Make sure Header Search Path -> Release is also filled in.

Different behavior on Xcode and xcodebuild

I have a CI environment which builds my project. So when I compile my project with xcodebuild -target MyTarget and run it on a physical device, I get a visual bug with one of the Three20 libraries as well as a reproducible crash.
However, when I compile and run the project and the same target via Xcode I neither have the crash nor the visual problem.
Since I don't do anything fancy with xcodebuild I would expect the two builds to be identical. Generally I'd rather have the problem in two places than the two builds behave differently.
Has anyone run into similar issues and how can I make sure that the product of Xcode and xcodebuild is identical? Thanks a lot for your help.
Try running xcodebuild -scheme MyScheme, where MyScheme is most likely the name of your target if Xcode auto-generated the scheme for you.
The GUI uses schemes when building and I've found that you can usually get the same behavior by specifying a scheme to xcodebuild.

Linking libcsoap to iPhone project in Xcode

I have an iPhone project that I want to use libcsoap in to make service calls. I'm having trouble linking a pure c library to xCode though. I've tried everything short of manually rebuilding the project as an Xcode project.
I built it via command line (./configure; make; make install). Then linked the output (libcsoap.a) and connected to the headers. This gave me a linker error saying that libcsoap.a was built for archiving and couldn't be used.
I tried creating a project out of just the makefile but that failed to build.
Can anybody explain to me what I should do to link these?
Thanks in advance,
George