Xcode 6.3 + trying to run Watch app in simulator results in "FBSOpenApplicationErrorDomain error 4"

I am writing a Watch app for one of my apps. Since my team doesn't have an Apple Watch yet, I also build a version of my Simulator app on my build server for my QA team and they use "xcrun simctl" to run and test the watch app itself.

Everything went well until Xcode 6.3 came out. With Xcode 6.3, I got this error when I tried to build the app locally on my development machine:

error: The value of CFBundleVersion in your WatchKit app Info.plist (1) does not match the value in your companion app Info.plist (2.0.492). These values are required to match.

      

To fix this problem, I modified the info.plist files to contain the same ones CFBundleVersion

. This modification fixed the build issue on my local dev machine, but: QA can still launch the iOS app, but launching the Watch app with this error:

> xcrun simctl launch 0D5238ED-CBE9-4DCC-961D-BC756E0885CD com.company.enterprise.appname.watchapp
An error was encountered processing the command (code=4):
The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 4.)

      

I don't see anything in the system console log that could be related to this.: /

Do you know any ideas how to solve this problem?

Thanks in advance for your help!

+3


source to share


3 answers


I found out that adding CFBundleGetInfoString to watchKit Extension / watchKitApp caused a problem for me (it's ok if it's in the iOS cellular app itself). Removal which solved the problem for me.



defaults delete `pwd`/myApp WatchKit Extension/Info CFBundleGetInfoString
defaults delete `pwd`/myApp WatchKit App/Info CFBundleGetInfoString

      

0


source


I run into this too.

Basically, you should have 3 goals (4 if you count tests). If you check the build phases, you will see that the WatchKit app must first compile, then the WatchKit extension, and finally the main app.

I have a script that I've used for centuries that automatically updates the CFBundleVersion every time the application is compiled.

The Build Phases for Extension and the main application have a Run Script space, but not a WatchKit application.

So the first thing that gets compiled is the WatchKit app, then it is moved to the build directory. It will have any number in the CFBundleVersion that was last manually entered.



The second thing that gets started is compiling the extension. Here's my script running and updating the number. However, the number is now greater than the number in the WatchKit app, which has already been moved to the build directory. So, although they started life as the same number (say 1), by the time the extension is carried over, it is now 2 and there is a mismatch.

It is not possible to update WatchKit App CFBundleVersion in an automatic way using Run Script.

Personally, I decide how to set the CFBundleVersion manually in my WatchKit app, when I want it to change, then I will have scripts running in build steps for two other purposes, copy the CFBundleVersion from the WatchKit app to the corresponding CFBundleVersions to keep them all in sync.

In short, you have three CFBundleVersions to track and make sure they are the same number.

+2


source


For Watch apps to function properly, certain properties must match in the Watch app and its app extension (18857540):

  • The property WKAppBundleIdentifier

    for NSExtensionAttributes

    in WatchKit Info.plist app extensions must match CFBundleIdentifier from WatchKit App Info.plist.
  • The WKCompanionAppBundleIdentifier

    Watch.Kit App Info.plist component property must match the CFBundleIdentifier

    containing iOS application .plist.
0


source







All Articles