how to avoid opening the terminal

Discussion in 'Mac Programming' started by silvercircle, Dec 22, 2013.

  1. silvercircle macrumors member

    Joined:
    Nov 18, 2010
    #1
    Is it possible to launch this this application by double clicking on it and not open the terminal?
    By default if you launch a command line app, the terminal is also launched.
    Is there a way to keep the terminal closed?
     
  2. Macman45 macrumors demi-god

    Macman45

    Joined:
    Jul 29, 2011
    Location:
    Somewhere Back In The Long Ago
    #2
    You want to run Terminal commands without the application? I can't see how.
     
  3. silvercircle thread starter macrumors member

    Joined:
    Nov 18, 2010
    #3
    I compiled that application in Xcode, not via the terminal. I should have said that in my first post. Sorry.
    So, I don't use any commands, just launch the application like any other.
     
  4. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #4
    Oh, I gotcha. Did you remove the echo and the compiler stuff at the end when you pasted it into Xcode? Also, make sure you're using the right application template.
     
  5. bumper314 macrumors member

    Joined:
    Jun 23, 2009
    #5
    In order to run like any other app, the executable must be inside a bundle with an Info.plist file like this:
    http://d.pr/f/xtPF/2m408kHa

    What exactly are you hoping to achieve with this example? I've done a LOT of research into minimizing application memory usage, and as you're likely to find with this Minimal example, you don't save much memory compared to the normal Cocoa Application template in Xcode. Most of the memory is used to buffer the window. Even a small window will use 5mb RAM and a full-screen window at 1920x1200 will use about 20mb.
     
  6. silvercircle thread starter macrumors member

    Joined:
    Nov 18, 2010
    #6
    Ok, so this is the only way? I don't want to use a bundle, just a stand alone command line tool.

    I took this as an example.
    I'm writing a command line version of my application. There are a few people who need to run my application from within their application with a few options. I simply wanted to avoid in this case that the terminal shows up.
    I don't need the terminal, I have my own windows for text and other output.
    If I make a bundle, you have to cd deep to execute it on the terminal (for those who invoke it directly from the terminal).
     
  7. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #7
    No, you don't:
    Code:
    open -a AppName
    OR
    open /path/to/AppName.app
    works just as well.
     
  8. silvercircle thread starter macrumors member

    Joined:
    Nov 18, 2010

Share This Page