Xcode Won't Compile To Simulator - xcode

I've just updated Xcode 4.5 via the App Store, from my previous version which I got from my Apple Developer Account. Since the update I can't compile any apps into the Simulator. I can compile onto a device, e.g. my iPhone.
The error I recieve is
fatal error: file
'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/
Developer/SDKs/iPhoneSimulator6.0.sdk/usr/include/Availability.h'
has been modified since the precompiled header was built
1 error generated.

go in ~/Library/Developer/Xcode/DerivedData/{project name + gobly-gook} and delete folder with your project name.
EDIT After suggestion
NOTE:
By default Library Folder is hidden so we can't see it.
So we have three way to use this hidden ~/Library folder
1.Unhide Library folder by following command to unhide ~/Library folder
chflags nohidden ~/Library
Now you can see Library folder as /Users//Library
2. Open GO menu of finder and press Alt key and Library will be visible as new menu item.
Select that to open Library folder
3. You can access ~/Library folder by Terminal.

There's easiest way: Just "clean" project (Product > Clean)

You can just open the Organizer (top-right corner of XCode), go to the Projects tab, select your project on the left and then delete the Derived Data.

This happened when I updated Xcode from 6.0.1 to 6.1
I cleaned the project and could compile successfully!!

Related

In Xcode, where is the compiled .app file? (macOS application)

On iOS I did not bother with that info, because you run the app on the device or simulator.
This is macOS application.
I want to launch my app without Xcode. Where is the app file location?
I'm using Xcode 10.
It is in the Products group in Xcode.
If you want to know the actual location in the file system:
Right click > Show in Finder:
After the build, you can find it under Products, you can find it in the Project navigator writing .app (it is located on disk in the derived data folder).
In case you are looking for the folder of compiled programs:
By default it is present in :
Macintosh HD >
Users > (user name) >
Library >
Developer >
Xcode >
DerivedData
DerivedData is the folder where all the compiled programs are kept. You need to access the:(desired) folder > Build > Products > Debug to access the executable app.
For easy access I'll suggest to make Alias of the DerivedData folder onto desktop.

Problems running on iOS

I've tried on 3 different computers but it still has the same problem that prevents me from running the project on the Mac. When I use Windows and connect to my Mac to run, it shows the same error on all 3 computers.
The error message displayed:
Can not resolve reference: /Library/Frameworks/Xamarim.iOS.framework/Versions/Current/lilb/mono/Xamarin.iOS/Facades/System.Memory.dll
Quick fix steps
VS on PC:
in iOS poject open References list
find Xamarin.iOS and check the path in properties
open containing folder, open Facades folder, copy System.Memory.dll
Mac:
open Finder and Go > Go to folder... > type Library
find:
Library/Frameworks/Xamarim.iOS.framework/Versions/Current/lilb/mono/Xamarin.iOS/Facades/
paste System.Memory.dll
.. rebuild and you are good to go
From what I understand, this is usually do to a pending update for Xcode.
Make sure Xcode is installed and updated. Once it is updated, launch Xcode to ensure that all updates are finished(I don't know why, but a lot of times you have to run Xcode for the update to finalize.)
Then clean and rebuild your project. That should fix the issue.

xcode command line app - where is the executable code?

I'm writing a small command line tool/app in Xcode 6. After a steep learning curve (that I'm still climbing) I've got my code working in main.m without errors. My question is: does Xcode build some executable code that I can run from the command line inside a Terminal? I've tried "Build" and "Run & Build" but I don't see where any executable code is created. I'm very new at Xcode and need some help. I'm running OS X 10.9.5 and Xcode 6.1.1 on a Mac Mini.
If viewing my code would be useful, let me know and I'll put it up.
Thanks for any assistance.
Kevin H.
It's hidden very well. In Xcode 6, when you build an app, there is a folder "Products" in the project navigator (left pane). The name of your project will be there too. Right click, and select "show in finder". It will show you an obscure folder hidden deep in your OS X Library where the executable is located.
To copy the executable to a more convenient location each time you compile go into the project settings and select the Build Phase.
Type in a absolute location such as: ~/Documents/dev/temp. (It does recognize ~ as the current users home directory)
Then Press the '+' Button Under the 'Copy Files' Section and Select Your File (Select Your executable under the Products Folder)
Deselect the 'Copy only when installing' button. Then build and it should be at that location.
To launch just open the terminal app and go to that location. The executable should run unless there are dynamic libraries it calls that are not in the lib path.
Hope this helps
The binary is in a folder under /Users/Username/Library.
Something like:
/Users/<Username>/Library//Developer/Xcode/DerivedData/.../Build/Products/Debug/<ProjectName>
You can easily find it with this command:
find /Users/<Username>/Library/ -name "<ProjectName>"
replace "Username" and "ProjectName" accordingly to reflect your environment.
"Find" works, but you could also view the build log output and look for "CreateBuildDirectory" and copy the path from there.
Example below:
In Xcode 14 the path is nested under the line that says "Create build directory $(DERIVED_DATA_DIR)", but you can see the full path by expanding the icon on the right of the output.

Where does xcode resolve "$(BUILT_PRODUCTS_DIR) to on my system?

When Compiling for iPhone Simulator with Xcode 4.2, if I place
"$(BUILT_PRODUCTS_DIR)"
in
Build Settings / Header search paths / Debug
and exit editing I can see it resolves to:
"build/Debug-iphoneos"
Where should this be on my system? I have looked in:
Library/Developer/Xcode/DerivedData/{Project Name}/Build
but I can't find a file called build that contains a folder called Debug-iphoneos.
On my system, compiling an OSX project, that resolves to an absolute path:
BUILT_PRODUCTS_DIR /Users/andy/Source/MyProject/build/Debug
There are so many Xcode build variables that I keep a text file with a sample list of them which I got from executing a custom build script and viewing the output within the log tab.
If your code is going into the Library folder, then that is hidden under Lion. You can unhide it from the command line (Terminal) using:
$ cd ~
$ chflags nohidden Library
You should then be able to see its content.
Another tip: I have a ~/tmp folder where I let temporary stuff accumulate and I have set my Xcode preferences to put DerivedData and Archives into that folder so I can:
delete it now and again (I don't like temporary stuff accumulating where I cannot control it).
see it for packaging pre-release Archived project to testers.

Growl-WithInstaller.framework keep failing on Xcode4

These are my steps
I downloaded the latest Growl sdk and put the Growl-WithInstaller.framework in the /Frameworks folder.
Drag & drop Grow-WithInstaller.framework directory to "Framework" in project, Copy Items into destination folder...
I see Growl-WithInstaller.framework in "Summary" -> Linked Frameworks and Libraries, marked as Required
Then created a new build phrase, Copy Files. Drag Growl-WithInstaller.framework from the left side of the Project navigator to it the column row. Set Destination to Frameworks and also set Copy Only when installing.
Then I keep getting this error:
dyld: Library not loaded: #executable_path/../Frameworks/Growl-WithInstaller.framework/Versions/A/Growl-WithInstaller
Referenced from:... Reason: image not found
Did I missed any steps? Of course if I copy the Growl-WithInstaller.framework to /Libararies/Frameworks, then everything works fine, but if I try to run the app in a Mac with the framework in the /Lib, then it will break.
Help.
Uncheck "Copy only when installing" so it doesn't only copy when installing.

Resources