How do you create a Shell Script target in Xcode 4.2?
Asked Answered
M

1

16

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

Mannose answered 1/2, 2012 at 0:10 Comment(2)
Do you need to run this script alone or this should be run after or before a build of particular target?Pessa
Should be before (but answered below).Mannose
G
31
  1. Select your project in the navigator
  2. Click "Add Target" - Choose "Aggregate" for an empty Target
  3. Add Build Phase -> Add Run Script
  4. Click Build Phases and edit the Run Script Phase
Glutamate answered 1/2, 2012 at 1:53 Comment(5)
why do i keep on bumping into you on SO? :)Four
@Four probably because i spend too much time here :)Glutamate
actually i came across this question there is this library i'm using 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 :pFour
An 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.Monochromatism
I'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? ThanksHypsometer

© 2022 - 2024 — McMap. All rights reserved.