Getting black screen on Watchkit simulator and “Waiting to Attach” when adding to existing project

有些话、适合烂在心里 提交于 2019-12-03 20:33:39

Are you using iOS 8.2 simulator ?

I had similar error, switching to simulator with iOS 8.3 fixed it for me.

user4043752

Check that your build target is the Watchkit App. I had it set to the main app so the main app was launching in the sim, but the watch app was blank.

referenced here.

How to run a WatchKit App

I am also running into a similar problem but not on the simulator but on the Apple Watch device. Try setting Skip Install to NO in the WatchKit App target settings

After working with Apple, it appears as if this was an issue with Xcode creating the target. Our app is several years old, and for some reason when creating any new target, the Wrapper Extension is set to "app" every time. This has caused us issues in the past with trying to add testing targets as well.

We were able to fix the issue by going to the Watchkit Extension target, and changing the Wrapper Extension from "app" to "appex". Make sure you leave the Watchkit App target to "app". We asked why Xcode wasn't doing this automatically for this particular project, and it's because the overall project target has the Wrapper Extension set. If you create a new project, you'll notice that Xcode now leaves this blank.

Hope this helps someone else.

Sometimes, restarting Xcode solves the problem.

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

I tried everything but nothing helped. Then I backed up the watch app and watch extension folders. After that I removed the watch app and watch extension targets and created new targets. Then I restored the files from the backup. It's an awkward approach but it solved the "waiting to attach" problem.

Xcode 10.0; Swift 4.2; iOS 12.0

I had the same issue with Apple Watch simulator. What actually solved it was deleting the default Siri watch face from the Watch App on the iPhone simulator.

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