简体   繁体   中英

Impossible to run my Apple Watch application in iOS Simulator

I'm trying to run an Apple WatchKit target with my Universal app, using Xcode 6.2

I'm probably doing something wrong, but I can't access to the simulator in the scheme menu

在此输入图像描述

Any idea ?

Have you tried to attach it in the iOS simulator?

附加在硬件/外部显示器/ Apple Watch中

This appears to be a bug that at times affects some Build Schemes for some reason. Fortunately, it is easy to fix.

  • In the menu that appears in your screenshot, select "New Scheme".
  • Select your WatchKit App as the target, and give it a name. Click 'OK'.
  • In the new entry in the Schemes menu, you should now be able to open your WatchKit app in the simulator.

You can also correct this issue via "Manage Schemes" and removing and re-adding your existing WatchKit App.

No luck?

For those who are still having a headache after doing this list of things:

  1. Creating new schemes
  2. Hacking Targeted Device Family
  3. Autocreating schemes
  4. Clearing Derived Data and Module Cache cleaning Project
  5. Restarting Xcode, Mac

History

It took me about 3 hours to get rid of no targets (my case was My Mac target), I copied the project somewhere to keep my current data and I did these things to inspect:

  1. Deleting current targets ( AppExtension and WatchKit )
  2. Creating them again (for my surprise the iOS Simulator this time came up)
  3. Opening Product -> Scheme -> Edit Scheme
  4. Selecting a scheme which target is WatchKit App
  5. Under Build I see that my old scheme had only its own target (WatchKit one) while the new that was generated from new targets had 3 targets (MainApp, WatchKit and WatchExtension)
  6. I did the same thing to my old ones by adding target, and the simulator came up, ran it and worked perfectly

Solution

  1. Open Product -> Scheme -> Edit Scheme
  2. Select your WatchKit Scheme
  3. Select Build and if you see only one target, that could be the case, add the other required target (in my case were MainApp and WatchKit Extension)
  4. If it works, cheers :)

Hope it helps somebody

This is likely the issue reported in the Xcode Release Notes whereby Xcode can't communicate with the simulator service if you rename Xcode.app. Please reboot your system.

Renaming Xcode.app after running any of the Xcode tools in that bundle may cause iOS Simulator to be no longer be available. Either rename Xcode.app back to what it was when first launched or restart your Mac. (16646772)

If you open the Watch Kit project in lower versions of Xcode (6.1 and below) you wont get the simulator options.

Not sure if you have done the same, but I just observed this today.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM