![]() ![]() Specifically, you can add a “Run Script” phase, which instructs Xcode to run a command-line script, such as a shell script or a Ruby script, at a given point in the build. The invaluable thing about build phases is that you can add your own. The major steps it goes through are exposed to you in the form of “build phases.” You can access the build phases by selecting your application in the main navigator pane, then selecting the main app target, and then choosing “Build Phases” from the list of tabs along the top. When you hit ⌘B to build your project, Xcode begins a complicated process that begins with the set of text files, resources, and configuration files that consitute your program, and ends with the production of an executable application. ![]() There are three ingredients in this recipe: Xcode build phases, AppleScript, and the osascript tool. (As the prompt indicates, I’m also set up to automatically increment the build number for each non-Debug build, but that’s a separate topic.) I began experimenting, and the result was this technique for making Xcode check with me before carrying out a non-Debug build. After I accidentally made a release build for the tenth or eleventh time, it started feeling like Xcode should really be helping me out here. When I’ve switched the Xcode build settings to a Release or ad-hoc build configuration to bundle an app for distribution, I’m almost incapable of remembering to set it back afterwards. Why would you need an interactive build? In my case, it warns me when I’m about to make an all-too-frequent mistake. In this post, I’m going to illustrate an approach I’ve used to add a touch of interactivity to a project build. Apple’s Mack truck of an IDE, Xcode, doesn’t give you a lot of room to mess with its build process, but there are a few options for customization.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |