Executable file in xcode - objective-c

How to get the executable files from the xcode

If you're meaning to ask how to retrieve a compiled executable from a built Xcode project, you can find it in the build/Debug or build/Release folder in the project folder, depending on the build settings of the project.

Related

How to use msbuild to generate a VS .sln file where everything is on x64 platform?

When I build my project in command line, everything works fine. But when I tried to generate a .sln file for the project by running msbuild /t:SlnGen /p:Platform=x64
at the command prompt, and then click build in VS (debug, x64), I got an error saying it can't copy a dependent binary folder because it is not found. Since my project is on CBT, I have x64, x86 and Any-CPU platform settings. My project used to be built on CoreXT. My suspicion is VS build doesn't handle the output path of the dependencies correctly.
Then how can I build the solution only on x64 through VS?
Any hint will be very helpful!

xbuild - where is the compiled app?

I have just started using xbuild to compile my C# solutions using Visual Stuido's .sln files. The outcome is two folders: bin and obj placed in the same localization as the .cs files of the project.
Both of them contain folders for Debug and Release versions, and both those versions appear to be the same application when I run them.
Is there any difference between those apps in bin and obj? And if there is, which one is the "complete app" I am "supposed to" run? Or am I missing some flag/option? Which files are necessary for the app to run (if I wanted to move just the executables and would like run them, which ones are necessary?)
I am using OSX (10.10.2), XBuild 12.0 and Mono 3.10.0.0 , if that is necessary.
Thanks in advance.
Long story short:
bin/Release/ are the files you should deploy.
bin/Debug/ are the files you should test in your developer machines.
Files in obj/ are useless, you can remove them.

Build Cocoa application Bundle with private dylib/framework

I use xcode 4 to build a cocoa application with a private dylib/framework.
In my development Mac, I put the dylib in the /usr/local/lib directory, and drag it into the project.
The app is compiled and runs perfect on my computer.
To distribute this app to the other Mac, I create a copy Files building phase, and say "copy that dylib to Frameworks directory".
The application is built successfully, and I indeed see the dylib is copied to the Frameworks directory in the app bundle.
The problem is when I run this app in another regular Mac, which does not have this dylib installed. I get an error saying:
dyld: Library not loaded: /usr/local/lib/mylib.dylib
The issue comes from the fact that you copy the framework into the app bundle, so it is available at a location like:
<you_app_path>/Contents/Frameworks
but you try to load it from /usr/local/lib where it is not available on you deployment machine. From Apple Framework Programming Guide:
To embed a framework in an application, there are several steps you must take:
You must configure the build phases of your application target to put the framework in the correct location.
You must configure the framework target’s installation directory, which tells the framework where it will live.
You must configure the application target so that it references the framework in its installation directory.
Now, you say that the build phase is ok; I assume also that you sent the application target build setting correctly. What is left is configuring the framework target’s installation directory.
If you did not build the framework yourself, you should be able to fix this by changing the framework install path so that it is defined relative to the loader (your app), to something like: #loader_path/../Frameworks/ (or #executable_path/../Frameworks). You can do that by means of install_name_tool.
If you are compiling on your own the private framework, you can define its install location in Xcode build settings.

Linking the new Google Api To Xcode 4

I am fairly new to xcode and objective C in general, but have done a fair share in Microsoft.Net and visual studio.
I have just check out the latest google api objective c project. I am looking to add this as a static library to my xcode 4 project.
What i have done:
Add the project file to my existing project.
Link up the dependency on my project build phases
Under Build settings, I have enter -ObjC -lxml2 -all_load
I have build it without error. By running Shift + B.
But my issue is that when i try to enter #import "GTLTasks.h" i get an error no such file or directory.
Do i have to add the respective Service by itself? If so where should i add the files to the GTLxcode.project or my own project?
The service i am talking about is located in the following path source/services/
Sorry if i doesn't make sense as I am still exploring around in xcode and objective c.
Just for the record, I have managed to resolved this issue.
Under the Build Settings of the xcode project, Other linker flags
-ObjC -all_load
Followed by Header Search Paths
$(SRCROOT)/YourFolder/
Where your project folder is located this is where you will place your source files from google.

How do you rebuild a Xcode framework from source?

I am trying to alter the AWSIOSSDK framework so that it works for developing OSX apps, and I need to rebuild the binaries after I edit the files. But I don't know how to do this.
I have access to a src/ directory, which then has further directories of libraries, but there aren't any Makefiles or configure scripts anywhere in the folders.