xcrun does not support Packaging IPA with a WatchKit App

Originator:me
Number:rdar://21179648 Date Originated:01-Jun-2015 05:22 PM
Status:Closed as Duplicate of 16703091 Resolved:
Product:Developer Tools Product Version:xcrun Version 23
Classification: Reproducible:Always
 
Applications packaged with a valid WatchKit Extension and App are required to include both a `Payload`directory and `WatchKitSupport` directory.

Jake Behrens outlines in this Developer Forums thread https://devforums.apple.com/message/1119973#1119973

Further outlined in this blog post
http://www.matrixprojects.net/p/watchkit-command-line-builds

Xcode 6.3.2 (6D2105) will automatically package WatchKitSupport into a .ipa when Archiving and Exporting.

When using `xcrun` in a command line script to perform the packaging manually, the .ipa is generating without the WatchKitSupport/WK needed. 

This is not documented clearly anywhere, aside from in a brief post in the Developer Forums.

Current workaround involves manually unzipping an .ipa, copying in a file from a hard coded location in the iOS SDK and repackaging the .ipa file. This is not a long term solution.

See below for sample -

xcrun \
-log \
-sdk $IOS_RELEASE_SDK PackageApplication "$PWD/$OUTPUTDIR/Products/$APP_NAME.app" \ 
-o "$PWD/$OUTPUTDIR/Products/$APP_NAME.ipa" \
-sign "$DEVELOPER_NAME" \
-embed "$PROVISIONING_PROFILE" "$PROVISIONING_PROFILE_WATCHEXT" "$PROVISIONING_PROFILE_WATCHAPP"

# Extract IPA
unzip "$PWD/$OUTPUTDIR/Products/$APP_NAME.ipa"

# Include WatchKitSupport
mkdir "$PWD/$OUTPUTDIR/Products/$APP_NAME/WatchKitSupport"
cp "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/Library/Application\ Support/WatchKit/WK" WatchKitSupport/WK

# Repackage
zip -qr "$APP_NAME.ipa" Payload WatchKitSupport

Steps to Reproduce:
1. Open Xcode Project with WatchKit app
2. Use Xcode to Archive and Export an .ipa
3. Use xcrun to Package application as an .ipa
4. Compare the .ipa contents
5. Note that Xcode's output .ipa includes the WatchKitSupport directory but xcrun's output does not.

Expected Results:
xcrun should generate the exact same output as Xcode including the WatchKitSupport/WK files.

Actual Results:
xcrun generates an .ipa that does not include all required files for WatchKit application deployment.

Version:
Xcode 6.3.2 (6D2105)
xcrun Version 23

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!