Ariadne
Ariadne

Reputation: 21

Can only load either the watch app or the Phone app in the Xcode simulators

Can't believe this is causing me so many problems.

I have written a simple watch and phone app in the same project so I can start to learn about the connectivity between the two. This simple app just uses the dictionary method of data transfer so the code is straightforward and simple. The code is Swift3 in Xcode 8 (latest beta as at 21/09) and Watch OS3.

My problem is that I can't test whether data is passed from the phone to the watch because when I run the project I can only run either the phone app or the watch app, I can't run the two together in the simulators.

List of simulators when selecting the Phone app

If I run the phone app, then the phone simulator starts up with the watch simulator but only the phone app is installed. Nothing is installed on the watch simulator, this is confirmed in the console that returns the error that the 'App is not installed on the target' after I press a button to send a message. The connectivity session starts as I have checked this with output to the console.

If I run the watch app, then the phone simulator starts up with the watch simulator but the only the watch app is installed. Nothing is installed on the phone simulator.

I have tried everything suggested in other posts but nothing allows me to load the apps on the phone and the watch simultaeneously so that I can transfer data between the apps. In fact, it all makes prefect sense that both apps don't start as I can't find anywhere that says the two executables should be started up together. I have the same problem in XCode7 running watch os2.

It just seems really bizarre so I am sure I am missing a flag or something somewhere but nothing on the Internet or in the documentation is of any help.

Thanks in advance for any help in resolving this.

Upvotes: 1

Views: 161

Answers (1)

Jeremy Huddleston Sequoia
Jeremy Huddleston Sequoia

Reputation: 23651

You cannot run both at the same time through Xcode's Build & Run facility, but you can certainly run both at the same time through Simulator.app and Simulator (Watch).app. Just launch your app from the home screen on each and debug as you want. You can use lldb directly from a terminal or attach to the running processes from Xcode. If you want to launch the apps suspended, so you can attach with the debugger early in the launch process, you can do that as well using xcrun simctl launch ....

Upvotes: 1

Related Questions