Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 15, 2008, 11:10 AM   #1
moore1879
macrumors newbie
 
Join Date: May 2008
How to Create .app

I have run into this before but never thought to post to a forum. I like open source software, however sometimes it's annoying to install an application and only have it open via command line. This brings me to the question, if I have the source code, what would it take to create a .app from that? Let us assume that there are no dependencies.

A link, a step-by-step walk through, anything like that would be helpful.

I am running 10.4 and have Xcode installed.
moore1879 is offline   0 Reply With Quote
Old Aug 15, 2008, 02:16 PM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
A .app is a GUI application. So if you have code meant for the command line, you would need to figure out how to wrap a GUI around it. And to do that you need to learn Cocoa. Easiest way to get started is Xcode > File > New Project > Cocoa Application. That will give you the essentials but you may want to look into a Cocoa tutorial to go further.
kainjow is offline   0 Reply With Quote
Old Aug 15, 2008, 02:42 PM   #3
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
It would be 100x easier to just write a little GUI utility that makes calls to the command line than actually rewriting the command line tool to have a GUI itself.
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote
Old Aug 15, 2008, 03:26 PM   #4
moore1879
Thread Starter
macrumors newbie
 
Join Date: May 2008
Take, for example, GIMP. You can install it using MacPorts. When you do it has a gui that runs using X11. However, you don't get a .app directory for it. So, you must run it using a command line call. How can you take an application like that and turn in into a .app?

For the record, GIMP is just an example. That is not why I want to do this.
moore1879 is offline   0 Reply With Quote
Old Aug 15, 2008, 03:44 PM   #5
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
Quote:
Originally Posted by moore1879 View Post
Take, for example, GIMP. You can install it using MacPorts. When you do it has a gui that runs using X11. However, you don't get a .app directory for it. So, you must run it using a command line call. How can you take an application like that and turn in into a .app?

For the record, GIMP is just an example. That is not why I want to do this.
Why do you need too? Just install the command line tool and the write a GUI application that just makes calls to the command line tool. Then all you need to do is run the GUI application and it will handle all the command line stuff for the user.

You don't need to touch the original applications source at all.
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote
Old Aug 15, 2008, 04:29 PM   #6
moore1879
Thread Starter
macrumors newbie
 
Join Date: May 2008
Because the application already has a GUI. I don't need to create the GUI. The only way to run the application is to type in the name of the application. I can run the application, but it has to be run from the terminal window. I can type in "eric". and it runs the application; however, if I close the terminal window, it kills the application. I can run it from an applescript, but the applescript must continue to run or the application is killed. Why would I write a GUI for an application that already has a GUI?
moore1879 is offline   0 Reply With Quote
Old Aug 15, 2008, 04:34 PM   #7
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
Quote:
Originally Posted by moore1879 View Post
Because the application already has a GUI. I don't need to create the GUI. The only way to run the application is to type in the name of the application. I can run the application, but it has to be run from the terminal window. I can type in "eric". and it runs the application; however, if I close the terminal window, it kills the application. I can run it from an applescript, but the applescript must continue to run or the application is killed. Why would I write a GUI for an application that already has a GUI?
Because you didn't state that at the start. If you want someone to give you a solution to a problem, in general it best to describe exactly the problem you have.

In that case if you really want to do it that way, I can only suggest you import the current build files into Xcode and then set the project up to compile a .app for you. You'll probably need to muck around with makefiles depending on the application.
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote
Old Aug 15, 2008, 04:56 PM   #8
lee1210
macrumors 68040
 
lee1210's Avatar
 
Join Date: Jan 2005
Location: Dallas, TX
As I understand it there is an X11 app and you want an application bundle... i haven't tried this, but this thread seems to discuss it:
http://forums.macosxhints.com/archiv...p/t-29984.html

-Lee
lee1210 is offline   0 Reply With Quote
Old Aug 15, 2008, 05:54 PM   #9
cazlar
macrumors 6502
 
Join Date: Oct 2003
Location: Sydney, Australia
So you just want to call the command line to start the app, but not have it via a terminal window. I'd write a tiny shell script to do that, and then save it as "blah.command". IIRC, that will be double-clickable and will auto launch a terminal window and then run your script. If you want to have it do it without a terminal window, make your script launch your "app" in the background (I think you can just put a "&" on the end of the call, not sure). It's been years since I did this, I think the terminal shows up still, but you can close it and your thing will still be running.
cazlar is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
What app did they use to create this? HiFiGuy528 Mac Applications and Mac App Store 4 May 3, 2014 06:49 PM
How do I create an app of my own website? T909 Mac Programming 7 Jul 16, 2013 08:56 AM
Looking for ipad app that can create tutorials. Sparky9292 iPad Apps 4 Oct 9, 2012 12:27 AM

Forum Jump

All times are GMT -5. The time now is 08:54 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC