I was wondering if anyone knew with XCode 4.1 how to create a shell script. The option for that doesn't exist, but it might be called something else in the latest version. Ta
Asked
Active
Viewed 1.0k times
16
-
Do you need to run this script alone or this should be run after or before a build of particular target? – Johnnywho Feb 01 '12 at 01:10
-
Should be before (but answered below). – Doz Feb 02 '12 at 04:10
1 Answers
30
- Select your project in the navigator
- Click "Add Target" - Choose "Aggregate" for an empty Target
- Add Build Phase -> Add Run Script
- Click Build Phases and edit the Run Script Phase

justin
- 104,054
- 14
- 179
- 226
-
1
-
1
-
actually i came across this question there is this library i'm using [mailcore2](https://github.com/MailCore/mailcore2) that *always* executes this shell script everytime i build it.. I wanna shut it off.. I'll let you know if I get stuck though :p – abbood Oct 07 '13 at 08:21
-
1An alternative to using a Run Script is to edit the Scheme and under "Run" > "Info" select `/usr/bin/sh` as the executable and under "Run" > "Arguments" select the script in "Arguments Passed On Launch" that you wish to run. This way you'll get the output in Xcode's console. In my project, I do this to run a Ruby script using `/usr/bin/ruby` as the executable and `$(PROJECT_DIR)/myscript.rb` as the argument. – Sandy Chapman May 06 '15 at 13:58
-
1I'm currently facing the same problem right now, difference is, there is no Aggregate option on Target in xcode 9.4.1. Can you please help me? Thanks – Lysdexia Jul 26 '18 at 07:42