Search code examples
ioswatchkitapple-watch

Error during installation of resigned watch os app


I'm trying to resign ios app with watch app. As usual, I delete _CodeSignature folder, run codesign with provisioning, certificate, and entitlements. It completes without error which is expected. Bud during installation from Xcode I receive the following errors:

Executable stub at ... watch.app/_WatchKitStub/WK not signed by Apple
The WatchKit 2.0 app being installed contains an invalid application executable.

Near the _CodeSignature folder there is _WatchKitStub with the only file WK there. What is the purpose of this file? Should I also resign it?


Solution

  • Apple expects (in part) the following structure:

    MainApp.app
    |
    +- Watch/
       |
       +- MainAppWatchApp.app/
          |
          +- MainAppWatchApp (WatchKit stub executable -- re-signed)
          +- _WatchKitStub/
             |
             +- WK (WatchKit stub executable -- unmodified)
    

    So WK shouldn't be resigned even if it's mach-O binary.