Search code examples
iosswiftwatchkitapple-watchwatchos-2

Will iPhone app run on iPhone not paired to an Apple Watch


I'm new to iOS development and I'm playing with Swift in Xcode working on a number of experimental projects.

In one of these I've designed an app for the Apple Watch (using the InterfaceController.swift in Watch App Extension) and in the same Xcode project I've also deigned a corresponding app for the iPhone (in the usual Main.storyboard, ViewController.swift, etc). When I run these apps using the iPhone 6s + Apple Watch - 38mm simulator, both apps run on each device as they should.

Now, if I connect my iPhone 6s and try to run the app, I get a message stating: "Could not launch 'App Name' on iPhone 6s. No paired Apple Watch."

I don't actually own an Apple Watch, so the error is understandable. But this got me to thinking and I now have the following questions:

  1. If I go through the process to submit this to Apple, will the iPhone app work for people as a standalone iPhone app if they have no Apple Watch? Or, are the apps in this project (both the iPhone and Apple Watch apps) only going to work for people who have an iPhone paired with an Apple Watch?
  2. If I want this iPhone app to be available to people with only iPhones, do I need to do anything special? For example,do I need to create a new Xcode project and effectively copy across the iPhone app from this project, or is there another approach I should adopt?
  3. What else do I need to be aware of? For example, do I need to rename the iPhone app to something different to make it available only to iPhone users? Is there anything else I should be aware of?

Solution

  • Regarding running the app on your iPhone, as Paulw mentioned in the comments, just change the execution target to the iPhone app. See screenshot: enter image description here

    Answering your other questions:

    1. The watch extension is an extension inside your iPhone app. iOS Apps with a watch extension work on all iPhones, even if they are not paired with an Apple Watch.

    2. Yes it will be available.

    3. You don't need to worry about anything else. The iPhone app will work on all iPhones. The watch app will show up on only those iPhones that are paired with an Apple Watch.