0

I have an Xcode project with iPhone and watchOS targets. The iPhone target uses the accelerometer, which the simulator doesn't support. Can I launch just the iPhone app without launching the watch target? I know from:

Can a real iOS device and Watch Simulator communicate for Testing purposes

that I can't pair a real iPhone with a simulated watch, but I'd be happy just to test the iPhone part on a real iPhone without hooking up a watch.

Community
  • 1
  • 1
jimm101
  • 948
  • 1
  • 14
  • 36

2 Answers2

2

Should be as simple as taking a look at the General tab of the project details and removing the entry listed under Embedded Binaries. This will stop the app compiling and bundling the WatchOS executable in with the iPhone one.

Cocoadelica
  • 3,006
  • 27
  • 30
  • I don't have any embedded binaries listed under the iPhone or OSwatch targets. Xcode 7.1.1. – jimm101 Dec 22 '15 at 18:46
  • Interesting. I think that means that there's no connection from the iPhone app to the Watch app so even if you ran them on an iPhone device the watch executable wouldn't be loaded. – Cocoadelica Dec 23 '15 at 10:55
  • I'm using sendMessage from the phone to the watch, and it works in the simulators. – jimm101 Dec 23 '15 at 12:16
0

If you build the iOS app with your iPhone as the device, it should install it on your phone with or without the Watch present. Are you getting an error?

Drewf
  • 414
  • 2
  • 7
  • Yes. When I select my iPhone with no paired Apple Watch, command-R gives "Could not launch 'project' on My iPhone ... No paired Apple Watch". This is why I'm assuming I'd have to build/run the iPhone target only. – jimm101 Dec 23 '15 at 12:13
  • I cannot test your scenario as I have a paired watch (and to unpair/re-pair takes a loooong time!) I tried it with bluetooth off, and it succeeded, however, that doesn't help you. Could you copy the project and delete the WatchKit extension and Watch app targets? Or, to ensure there are no lingering project settings, create a new iPhone-only app and add just the files you need to build the iPhone target. – Drewf Dec 23 '15 at 15:06