Build and Go not launching app in Xcode???

Discussion in 'Mac Programming' started by kashmoney2006, Apr 22, 2008.

  1. macrumors regular

    Joined:
    Dec 12, 2007
    #1
    So Ive been using Xcode to build this app ive been working on using openGL and GLUT. For some odd reason, starting yesterday after class, clicking on build and go will not launch the application. This has not been a problem as it has been working fine for weeks now, but now it will no longer show the app. It does say "<Application Name> Launched" at the bottom of the Xcode project window, and after clicking on the Stop button it will change to "Debugging Terminated". So it seems as though it is working except for the fact that the app is not being displayed. Can anybody help me? is there some kind of setting that may have gotten changed by accident, that is causing this to happen? and if it helps I am using Xcode 3.1. Thanks.
     
  2. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
    set breakpoints in the debugger. One at the entry and exit point of each major function. See if they get triggered.

    Litter these places with nslog messages as well.

    Doing these things you should be able to see where the program is or is not going.

    -Lee
     
  3. Guest

    caveman_uk

    Joined:
    Feb 17, 2003
    Location:
    Hitchin, Herts, UK
    #3
    I've had this happen quite a bit on Xcode 3.1 too. I don't know of a proper fix or what causes it. I usually just reboot and relaunch Xcode and it works again. Just relaunching xCode doesn't do the trick.
     
  4. macrumors 6502a

    Sayer

    Joined:
    Jan 4, 2002
    Location:
    Austin, TX
    #4
    Sounds like you set a breakpoint on some code somewhere and the debuger has stopped at that breakpoint waiting for you to continue or whatever.

    Along the top of the file editing window you should see a row of controls. One looks like a Pause/Play button for audio players. Try clicking on it.

    The other alternative is some code was deleted that starts up the GUI. Check the startup portions of your app and see if something doesn't look right.

    There's a new feature of Xcode 3 that allows you to make a "snapshot" of your project at any arbitrary point (kinda like Time Machine I guess). In the File menu select "Make Snapshot" and then you have a kind of backup of your project. You can make changes and roll them back later. View the snapshots in the "Organizer" in the Window menu.
     

    Attached Files:

  5. Guest

    caveman_uk

    Joined:
    Feb 17, 2003
    Location:
    Hitchin, Herts, UK
    #5
    I don't. I can close Xcode. Reboot the computer and then open the project and Build and Go works. There's nothing weird about the code. It also runs perfectly fine if I launch the built app from the finder.
     
  6. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #6
    This could be a bug w/ the debugger in XCode 3.1 if this spans projects and installations, and without any changes to the project a reboot corrects this. I'd file the bug with Apple. I would still try getting some NSLogs in there to see if the program is running at all.

    -Lee
     
  7. thread starter macrumors regular

    Joined:
    Dec 12, 2007
    #7
    That was the first thing i tried. nothing.

    I couldnt find a breakpoint set anywhere. I did click on the pause/play button and it didnt do anything. the only thing it showed in the organizer window was my iphone? I set a cout messages throughout my main function and none of them showed in the console. this is really frustrating. I can double click on the app under products and that will launch it, but id rather fix the problem than use a workaround. I even just made a new project that should just create a new window and that wont show either, nor do the cout messages show out to the console. no different. :(
     
  8. macrumors 6502

    Joined:
    Nov 30, 2005
    #8
    I'm getting the exact same thing with the Xcode 3.1 beta and the Allegro game library. I believe it to be a bug in Xcode, which wouldn't be so frustrating had I not only moved to the 3.1 beta because Shark was broken against 3.0.

    I find that if I build and launch a debugging session with no breakpoints set, then the application launches correctly — Xcode seems able to launch gdb and gdb isn't broken so it launches your app correctly. The only annoyance is that it takes several extra seconds as gdb does it's extreme slow loading thing.
     
  9. thread starter macrumors regular

    Joined:
    Dec 12, 2007
    #9
    i have no idea why, but it seems to want to work again. I dont think I did anything special. wow. anyways, Thanks for the help.
     
  10. macrumors member

    Joined:
    Mar 16, 2008
    #10
    I was having the same problem. I went through my whole project and removed all the breakpoints, and then it seemed to work (or, at least I think that is what made it work). It is good to note that going to Run->Debug never seems to fail in launching the app, although not as convenient as the toolbar button.
     
  11. macrumors 65816

    Muncher

    Joined:
    Apr 19, 2007
    Location:
    California
    #11
    Whenever it doesn't work, build it without launching then double-click on the app icon in the project window.
     
  12. thread starter macrumors regular

    Joined:
    Dec 12, 2007
    #12
    yea i was doing that, but that isnt a fix, just a lame work around. I mean come on, this isnt windows now, things should work as theyre supposed to. plus, doing it that way doesnt output anything to the console. so if you have things going out to the console for debugging purposes, it wont work.
     
  13. macrumors 6502a

    yeroen

    Joined:
    Mar 8, 2007
    Location:
    Cambridge, MA
    #13
    In Instruments, or in the terminal, just run a trace on the executable. See what comes out of stderr.
     
  14. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #14
    AFAIK it's a bug in 3.1, not something to do with the debugger or anything else. I had this problem the other day and just launched the app manually.
     
  15. macrumors member

    Joined:
    Jun 10, 2007
    Location:
    UK
    #15
    Application Build and Go

    I've had very similar experiences since I installed beta 4 (I've been using beta 1 since it came out and never had this problem). As an experiment, I've managed to get a sample set of projects to build and run consistently if I start a new project from within Xcode 3.1 beta 4 rather than open a project created with an earlier version.

    Edit: Actually scratch that - After 50+ test builds of new projects I now get mixed results for both new and old projects - so much for empirical data!
     
  16. thread starter macrumors regular

    Joined:
    Dec 12, 2007
    #16
    what seems to be working for me when i get that problem, is setting a breakpoint somewhere will cause the app to open. also sometimes the breakpoints seem to be overridden by Xcode? after setting the breakpoints Ill run the program, and the breakpoints will turn orange and wont do anything. the app will go on as if they were never there? anyone else have that problem? If I restart my comp. it will usually go back to working correctly.
     

Share This Page