Compile application from Xcode for deployment
I feel really stupid for asking a question like this, but I cannot seem to figure it out. I have an application that I wrote in Xcode 4.0.2 that targets Mac OS X. How do I compile this to an application bundle (.app) so I can make it available for people to test?
Thanks in 开发者_开发知识库advance.
If you are using Xcode 4, just click the 'Archive' command in the 'Product' menu. It will build your app using the Release build configuration so it's suitable to run on other computer's besides your own.
Once it's done building, it will open up the Organizer window with the Archives item selected and highlight the new archive it just created for your application.
Click the 'Share...' button and select 'Application' in the radio group, then click 'Next' which will bring down a save panel where you can pick a location to actually save the app bundle and do whatever you want with it from there.
Although I am not exactly sure how Xcode 4 handles the build directory of Mac apps, the last time I developed for Mac OS X, the application bundle could be found in /projectname/build/Debug. The specific directory inside the /build/ folder may differ according to the settings you set up, just look around a little. You can also specify the build location in your project build settings.
The .app bundle is a folder structure. Here's an example of a cross-platform app that uses a simple shell script to put the compiled assets into the right subdirectories:
http://git.gnome.org/browse/tomboy/tree/bundle-mac-app.sh
精彩评论