Search code examples
iosios-simulatorwatchkitwatchconnectivity

Can't run Watch and iPhone Simulator at the same time


I'm trying to send messages between an Apple Watch and an iPhone, using WatchConnectivity. But I can't run the app in both simulators simultaneously. I put a print in both viewDidLoad from iOS and awake(withContext:) from Watch, but only the second one is printed. It launches both devices, but my application is just opened in the watch.

screenshot of Xcode, Apple Watch simulator, and iPhone simulator

Does anyone have an idea about the problem? Thanks!


Solution

  • Of course you can debug both instances at the same time by the following steps.

    • Launch the watch instance from Xcode so it's connected to the watch simulator
    • Switch the target to phone app.
    • Go to Debug -> Attach to Process -> Select the phone app.

    Put breakpoints on both either app and they will both stop.

    Hope this help.