I have XCode Workspace in which i have many Projects. I don't want to build entire workspace every time. How can I build a single Project in Xcode Workspace?
In Visual Studio i can right click on project and select project only->Build but i didn't find any option in XCode..
You probably should do it with schemes.
Open scheme and remove unwanted targets. From Build section.
You can create a scheme for that. For reference: XCode Scheme
I tried creating a workspace and added two projects in it. It appeared on the Menu (From which you select between device and simulators) for which project I want to fire build action.
Related
I have a project for iOS, and another project for MacOS.
Now I want to combine them (I want to be able to see them both at once, to be able to share code, and to choose which one to build at the scheme).
I know I can go to one of the projects and create there a new target, but isn't is possible to copy a target from one project to another?
It would be a lot simpler, and may save some errors that might occur when creating a new target..
Edit: and what's considered to be better?
one project to hold 2 targets (iOS/MacOS) ? or 2 projects with 1 target each?
You can create a Xcode Workspace (.xcworkspace) under File -> New and then simply drag in both your Xcode projects under the same workspace.
I have 2 projects within my workspace (see screenshot), but when I make changes to my secondary project (SDK), it doesn't recompile them. For example if I just write random uncompiling code, it still compiles. Xcode also doesn't break at those breakpoints in the secondary project but it breaks in the primary project. I've tried deleting DerivedData and also cleaning the workspace. Any ideas? Thanks!
Check in the Utilities of Xcode if the .m files from your secondary project are in the Target membership.
UPDATE
I think I just replicate your problem on my side, and found the solution that fixes it. Try going in Products > Scheme > Edit Schemes. Select your primary project scheme in the upper left part of the view, the go in the Build section in the left menu. Click on the plus sign and add your secondary project target.
I have followed a tutorial on iOS-Framework. On the last part "Developing the Framework as a Dependent Project", I have created the framework project and a test project which includes the framework.
However, when I try to open at the same time both projects in XCode, I am getting :
Cannot open "MyLib.xcodeproj" because it is already open in another workspace.
How can I develop my framework and test it every 30 seconds like all the developers do?
I am using XCode 4.6.2.
The solution is to create an XCode workspace:
Choose File > New > New Workspace.
Enter the workspace name, and specify its location in your file system.
Click Save.
In the project navigator, Control-click in the empty space below the list.
Choose Add Files to “YourWorkspace”.
Navigate into the folder containing the project package.
Select the framework project xcodeproj and click Add.
Redo the steps 4 to 7 for the test project
I found the workspace documentation in the XCode User Guide.
I am working with the AR Drone to develop new application.
I want to establish a dependency between two projects. So when I compile one, I hope Xcode will help compile the another one automatically. I had searched with Google for this question. The solutions found are quite old and not applicable for Xcode 4.
Right now, I have two project, namely, ARDroneEngine.xcodeproj and FreeFlight.xcodeproj.
ARDroneEngine is a library for FreeFlight. Here comes the screenshot.
If I compile FreeFlight with iPhone / iPad simulator, it is fine since the ARDroneEngine is last compiled with the same setting. This is where the question lies. To test my application, I want to compile and run FreeFlight in my iPhone. So when I change the setting to "FreeFlight > xxx's iPhone" and compile, the error occurs: "Apple Mach-O Linker Error".
I think the problem is rooted from the Target Dependencies between two projects.
A quick workaround will be: Compile the ARDroneEngine again with the new Scheme "ARDroneEngine > xxx's iPhone" and launch FreeFlight in Xcode for my iPhone.
But I want a more complete solution with the dependencies between projects. If more information is required to solve the problem, I can always provide new info.
Thanks,
Steven
Xcode's solution to cases like this is to use a Workspace that encompasses both projects: then, when one project has a target that references the build product of another, it automagically works out the dependencies and builds them in order.
Create a new Workspace (File > New > Workspace); name it and save it anywhere you like (though putting it in a parent folder to both project directories might be a good idea).
Add both projects (drag the xcodeproj files from the Finder into the navigator pane, or use File > Add Files).
Expand the Products group of your library project so you can see the (placeholder for the) built library (libARDroneEngine.a).
Select the app project (FreeFlight) in the navigator and its app target in the editor -- you should be looking at the Summary pane for the target (the one with bundle identifier, deployment info, entitlements, and most importantly, the "Linked Frameworks & Libraries" list).
Drag the library (libARDroneEngine.a) from the navigator (where you made it visible in step 3) into the Linked Frameworks & Libraries list.
That's it! Now you can choose the FreeFlight > xxx scheme and it'll automatically build the library project before building the app.
You can probably get a more complete summary of these instructions (with screenshots and all) in the Xcode help for Workspaces.
I'm writing an app using Nuance's SpeechKit framework. I've just downloaded a newer version of the framework that contains new methods in some of the classes. To upgrade, I deleted the framework and the re-added the new one. When I right-click on the framework in Xcode and click "reveal in finder", it shows the new framework. When I open up the "Headers" subfolder of the framework in Xcode, I see the new methods.
The problem is that my class seems to still be referencing the header file in the old location, as the new methods are not visible within my application.
How do I upgrade a framework properly? Is there somewhere else in Xcode that contains a path reference to the SDK?
You need to delete Derived Data for the project - it is an option of the project in the XCode Organizer, on the projects tab. It will remove the cached build of the framework, forcing XCode to use the new one.
Choose Window/Organizer from the top menu
Click "Projects" pseudo-tab-thing, along the top of organizer window (icon looks like an XCode project file"
Select the project from the list on the left
Click "Delete" next to "Derived Data" in the area immediately below the project info header.
List item
EDIT: as of XCode 12 (should work with Xcode 8 and above), you can delete derived data like this:
Go to File > Workspace Settings if you are in a workspace environment or File > Project Settings for a regular project environment.
Then click over the little grey arrow under Derived data section and select your project folder to delete it in Finder.
I found what cause this issue for us.
When you build a new version you must update "Current Library Version".
There is also a "Compatibility Version"
In Xcode selector your framework target and in build settings search for linking and you will se this setting there.
We created a build script to bump this version number every time we build.
Xcode caches the frameworks and uses the cache if possible. That's why you need to change this number.
If you are using CocoaPods, run pod update [PODNAME].