Apple watch simulator issue

我只是一个虾纸丫 提交于 2019-12-29 05:45:10

问题


I am trying to debug and run the app on apple watch simulator. I have tried by using different target for notification, Glance and Watch app but apple simulator don't shows any thing.. It stuck in waiting for attach process of extension. I just see a black screen for the Apple Watch Simulator.

What did I do wrong?

How to overcome this issue ?


回答1:


I had the same issue. The only thing that helped was to delete and recreate the target scheme.




回答2:


This post from the dev forums solved my issue. More specifically, this excerpt:

  • In order for Watch apps to function properly, certain properties must match across the Watch app and its App Extension (18857540):
  • The WKAppBundleIdentifier property of NSExtensionAttributes in the WatchKit App Extension’s Info.plist must match the CFBundleIdentifier of WatchKit App's Info.plist.
  • The WKCompanionAppBundleIdentifier property of the WatchKit App's Info.plist must match the CFBundleIdentifier of the Containing iOS App's Info.plist.



回答3:


I have exactly same problem. I created a new project and added WatchKit extension in Xcode 6.2 beta 4 with WatchKit. I tried all ways mentioned in other answers but still failed to let watch app run in the simulator. Finally, I made it work.

My steps:

  1. Delete the containing app in the iPhone simulator.
  2. Clean your project in Xcode.
  3. Do not run the containing app, run the WatchKit app from Xcode.



回答4:


Before spending a lot of time on changing things, restart Xcode. Sometimes, this solves the problem.

Even if everything is configured correctly, it may take 20 seconds to attach the process to the debugger.




回答5:


You need to run the Watch App target and then from iPhone/iPad simulator check (Hardware -> External displays), any one of the Apple Watch options.




回答6:


I was experiencing the same issue. Mainly when creating an app extension in an existing app.

I was able to consistenly solve it by doing the following steps:

  • Make sure that the app extension gets the .appex extension. XCode tends to set it to .app. You can do this under 'build settings' -> 'wrapper'.

  • Under the 'Build Phases' tab in your target, your app extension should be listed under 'Embed App Extensions'. If you don't see this section, you can enforce it by adding a normal app extension to your app (fe. action extension). The section will now be visible. Replace the dummy extension you just created with the Watch app extension.

Start the host app and then start the Watch app, it should be working now.




回答7:


I had some trouble on iPhone 6 simulator, but each time I switch on iPhone5S it works.




回答8:


In my case the trouble was caused by a scheme with missing target although not the one I was trying to run. Hope that helps somebody.




回答9:


I was running into this problem as well and tried a few of the suggestions above. I found that deleting and recreating the target scheme resolved it. Everything is working fine now.



来源:https://stackoverflow.com/questions/27201559/apple-watch-simulator-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!