Re: Cannot produce executable target for command line tool in xcode 4.3
Re: Cannot produce executable target for command line tool in xcode 4.3
- Subject: Re: Cannot produce executable target for command line tool in xcode 4.3
- From: Roland King <email@hidden>
- Date: Thu, 19 Jul 2012 20:32:15 +0800
Doesn't work quite like that. You really wouldn't want Xcode stuffing random development code in /usr/local/bin every time you built it now would you. Xcode keeps all the built product in wonderfully segregated directories, segregated by platform, debug and release etc etc. So when you build a debug version of your app, it doesn't go stomp on the release one you built last month.
If you look at the build log (it's one of the tabs on the organizer), it's quite easy to find where it built what it ran in your debug session, for instance I have a PNG splitter, I just looked, it's here
~/Library/Developer/Xcode/DerivedData/PNGSplitter-ffmwyfapmkxfyggauphujryjzelm/Build/Products/Release/PNGSplitter
and I have a Debug version too, I think you can guess where that is. I believe that's a fairly default location, I don't remember messing with it.
So you can copy that if you like, but a better idea is to go to the product menu and select 'Archive'. That will build you a release (by default) version of your app and it will archive it into a package, you can then find that package in the Archives tab in Xcode (if you have the correct setting it even takes you right there). Inside that is an Info.plist file and the usr/local/bin (and usr/local share) you expected.
Once you get to that point I'm err not totally sure if there is something you can do to install that to /usr/local/bin, apart from just copy it, I just copy them myself. If there's a way to click and install, I don't know what it is. An Xcode guru will now completely embarrass me my pointing out a button I've missed. To see the contents of a package, just right click and select 'show package contents'
On Jul 19, 2012, at 7:52 PM, Joe Armstrong wrote:
> Hello,
>
> I'm trying to learn how to use xcode, and I can't even get the
> simplest thing to work. I'm running with a clean "out of the box" install.
> The software in question is
>
> Machine : MacBook Pro
> OS version lion: 10.7.4
> Xcode : 4.3.3
>
> My problem is that I have a command line program that works *within* xcode
> when I hit the run button, but does not create an executable that I can run
> *outside* xcode.
>
> I am totally flummexed. Here's what I did.
>
>
> 1) File -> New -> Project
> selected "Command Line Tool"
> name: test1
> Type: foundation
> Use automatic Reference Counting is ticked
>
> 2) This creates main.m
>
> #import <Foundation/Foundation.h>
>
> int main(int argc, const char * argv[])
> {
>
> @autoreleasepool {
>
> // insert code here...
> NSLog(@"Hello, World!");
>
> }
> return 0;
> }
>
> 3) Press the run button
>
> It says build succeed and runs correctly
>
> Now comes my problem - I want to run the program *outside*
> xcode from a terminal, bit no executable has been produced.
> Or if it has I can't find it.
>
> The Targets->Build Settings -> Deployment tab
> says the installation directory is /usr/local/bin
> so I had expected an executable called test1 to be
> in the file /usr/local/bin/test1
>
> /Joe
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden