Failed to install WatchKit App, error: Application Verification Failed

WatchKit Error

WatchKit hasn't been around for long and as is to be expected documentation is a scarce resource. Which has been both an issue and a blessing in disguise forcing me to dig deeper than usual and learn something I otherwise wouldn't.

I had an issue earlier with packaging an iOS + WatchKit bundle into an .ipa using xcrun instead of Xcode's Archive and Export functionality. Chances are you'll come across this issue. Installing your WatchKit app on your Apple Watch device fails with the following error message:

'Failed to install WatchKit App, error: 
Application Verification Failed'. 

You've got no stack trace and no console logs... so this could be one of many different things.

In my case this specific project involved a build pipeline that Archived, Code Signed and Exported the app automatically using a few fancy build scripts. This seems to be a common process allowing teams to have a deeper control over their Continuous Integration setup.

xcode-build

To accomplish this xcode-build is used to compile the Xcode project into an output .app file. You cannot distribute this .app file as it does not contain any Provisioning Profiles or Developer Certificates.

xcrun

Once an Xcode project is compiled into an .app file, xcrun is used to package it into an .ipa file. This is the file which includes your .app as well as Provisioning Profiles and Developer Certificates and is the package to be installed on a user's iOS device.

WatchKitSupport/WK Required

Until now I did not realise that an .ipa package has an inherent internal structure that must be adhered to at all times:

/Payload/
/Payload/Application.app
/WatchKitSupport/WK

/Payload/

Contains your .app file, which itself contains all your iOS applications assets, .xibs, .plists.

/Payload/MyApp.app/Plugins

Contains a MyApp_WatchKitExtension.appex file, which itself contains all your WatchKit Extension resources.

/Payload/MyApp.app/Plugins/MyApp_WatchKitExtension.appex/

Contains a MyApp_WatchKitApp.app file, which itself contains all your WatchKit App (not Extension) related files such as Storyboards, Assets and everything living on the Watch device itself as opposed to the Extension. It also contains the Watch Extension executable.

/WatchKitSupport/

Undocumented. Apps supporting a WatchKit App require this WatchKitSupport directory and within it a WK binary file.

xcrun vs Xcode

Knowing this I compared the output of xcrun with the output of Xcode's Archive and Export functionality.

Xcode

/Payload/
/Payload/Application.app
/WatchKitSupport/WK

xcrun

/Payload/
/Payload/Application.app

Then I discovered this forum post by an Apple Engineer in the Developer Forums, inadvertently describing the inability for xcrun to support packaging an .ipa for WatchKit support. His workaround and Kassem Wridan's workaround seem to be the only solutions to this issue.

This is definitely not a permanent solution to the problem but is a perfect opportunity for me to file a radar. If you're reading this you should do the same in the hopes this will one day be fixed.

If you have any questions, or corrections feel free to let me know.

Ex Machina

Ex Machina

I just watched Ex Machina, a British Sci-Fi film directed by Alex Garland and immediately loved it. Not only was it a beautiful film, true to the reasons I love the genre, but it was incredibly thought provoking and different.

Garland depicts a vivid future in which Artificial Intelligence has advanced far beyond where it is today. Distinction between human and machine is present visually but is questioned on a theoretical level.

It constantly plays with ideas of human intelligence and creationism yet it also has an underlying element of gender in its portrayal of the female form. Positioning of women is somewhat deliberate and representative of many existing present day concerns.

I thoroughly enjoyed this film and it has reignited my love for the Sci-Fi genre. I can't wait to see it again, dig deeper into the ideas Garland addresses and explore them further myself. If you haven't already, make plans to see it. Joshua Topolsky recorded this great episode of Tomorrow with Garland about the movie that's also well worth your time.

Finding space

People can be incredibly opinionated on Twitter and just in general. I say that because I'm also one of these people. It can be hard to find space to consider thoughts and ideas unless you know the sort of people willing to engage in serious discourse.

There's also the fact that I'm absolutely terrible at conveying my thoughts verbally, in emoji, or within 140 characters or less. Writing is tough but it allows me to focus on and deeply consider an idea that mightn't initially make sense to anyone else.

When I was younger I'd write relatively meaningless words I was passionate about on Posterous. I'd argue with myself about WikiLeaks and Chelsea Manning, try to convince myself Facebook was destructive and grapple with a philosophical perspective on absolutely anything. I still enjoy being critical and thinking things through. It has since defined the kind of person I've become, the work I love to do and people I know.

Like I did then, I'm setting aside a place on the internet for me to play with ideas, thoughts and questions. I've found there's a sub-concious difference between writing something that nobody will see and writing to yourself publicly. That's where this space fits in and will allow me to think out loud without needing to fit my words into someone else's expectations.

I may write long rants, share code or simply post photos. Either way take anything I say with a grain of salt (unless of course it piques your interest. In which case feel free to share it). Writing is only enjoyable for me if it's focused on an idea that I'm passionate about.

You might enjoy what I have to say if, like me, you're optimistic about the potential role of technology in the future but also know how to approach it critically. I tend not to hold a wholly pesimistic view of technology. It seems to always be in abundance but serves no real purpose.

I should mention that I'm an avid listener of podcasts. At the moment I'm keenly subscribed to Tomorrow, Roderick On The Line and The Partially Examined Life. I have a couple of pages left of Becoming Steve Jobs and as a Philip K. Dick fanatic I've just begun reading A Scanner Darkly.

There are few potential leads for posts in the works, so you should see something soon. Right now I'm thinking about 'affordances in design' or something along the lines of 'optimism and critical thinking'. Not too sure yet.

Thanks for reading