So with XCode4, as is kinda well known, building .IPAs can only be created used "build and archive" if only one target has "Skip Install" set to "No".
My problem is that our project contains multiple targets, that need to be shipped as .ipas at some point. Setting "Skip Install" on each on everytime i need to build an .ipa is annoying. Does anybody know of a better way, maybe using those scary "Configuration Files" I've seen mentioned somewhere? Currently, i'm using the .app from the .xarchive and build an .IPA the old way, packaging it in a Payload folder.
Asked
Active
Viewed 1.5k times
14

Blitz
- 5,521
- 3
- 35
- 53
2 Answers
29
How about xcrun PackageApplication?
Execute xcrun from command line.
PRODUCTDIR=DerivedData/foo/Build/Products/AdHoc-iphoneos
TARGET=targetA
IDENTITY="iPhone\ Distribution:\ foo"
PROVISIONING_PROFILE="/Users/foo/Library/MobileDevice/Provisioning\ Profiles/foo.mobileprovision"
OUTDIR=out
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${PRODUCTDIR}/${TARGET}.app" -o "${OUTDIR}/${TARGET}.ipa" --sign "${IDENTITY}" --embed "${PROVISONING_PROFILE}"

Community
- 1
- 1

Kazuki Sakamoto
- 13,929
- 2
- 34
- 96
-
what exactly is the Identity? What kind of string to you give? – Blitz Apr 19 '11 at 09:27
-
like this. "iPhone Distribution: Foo Co.,Ltd." – Kazuki Sakamoto Apr 19 '11 at 10:14
-
7Beware of not generating the ipa in the current directory (ie -o ./foo.ipa or -o foo.ipa) or it will be removed when the script ends. – Mick F Sep 05 '11 at 13:38
-
2OUTDIR must be an absolute path, e.g. OUTDIR=\`pwd\`/${PRODUCTDIR} – Graham Perks Jul 18 '13 at 19:04
-
@GrahamPerks:can u elaborate a little bit more on ur code i.e OUTDIR=`pwd`/${PRODUCTDIR} – Surya Deepak Aug 05 '13 at 07:06
-
Specified application doesn't exist or isn't a bundle directory – Vishal Singh Sep 15 '13 at 21:29
-
can you please tell how to use it? – Vishal Singh Sep 15 '13 at 21:30
-
I've been doing this all along but now with watch apps and extensions does this change in any way? – RPM Mar 31 '15 at 21:08
0
How about define several targets? That should you allow to adjust each separately for your needs.

Helge Becker
- 3,219
- 1
- 20
- 33
-
i have multiple targets. But every target has to have "Skip Install" set to "No" – Blitz Apr 15 '11 at 09:44