Watch-Only and Independent apps have no network connection when paired with an iPhone (Network Proxy through iPhone)

Hi there,

I think I may have caught a bug in the iOS system. Please confirm.

Problem

Newly installed Watch-Only and Independent apps on the Apple Watch do not have a network connection when paired with an iPhone until the iPhone is rebooted. Please see the attached screenshot; the iPhone indicates 'WiFi and Cellular policy: kDeny'.

Use Case

For our end-users, they will install the Watch-Only app directly from the App Store on the Apple Watch, and of course, their watch is paired with their iPhone. In this case, the Watch-Only app has no network connection at all after installation. The user has to reboot the iPhone once, and then the Watch-Only app can access the network. It is unacceptable for the end-users.

System Info

WatchOS: 10.1.1

Watch Model: A2770, Apple Watch Series 8 (GPS only)

iOS Version: 17.4.1

iPhone Model: iPhone 15

XCode: 15.3

How to reproduce

  1. Please download the very simple sample code attached. It features the official URLSession Demo Code, which initiates a default URLSession to access https://www.example.com.

  1. Prepare an iPhone and an Apple Watch, then connect the watch to the iPhone and ensure they are paired correctly.
  2. Ensure that your iPhone properly connects to a working WiFi network.
  3. Now, connect both your Apple Watch and iPhone to Xcode and run the code on the watch. Xcode will then install the Watch-Only app on your watch.
  4. After installation, click the 'Click' button on the watch app, and you will receive an error message stating 'The Internet connection appears to be offline...'
  5. Now, check the Console output of your iPhone and filter by 'wifi policy'. You will see logs stating 'Adding CU Policy: Bundle IDs: (the-bundle-id) Wifi policy: kDeny Cellular policy: kDeny'.
  6. Now, reboot your iPhone and wait for it to reconnect to the WiFi network.
  7. Check the Control Center on your watch to ensure the little green iPhone icon is displayed, indicating that your watch is now paired correctly with the iPhone. Click the 'Click' button again on the watch app, and this time it will work perfectly.
  8. To repeat the process, simply uninstall the watch app from your watch, and run the sample code again. Xcode will reinstall the app onto the watch. This time, the app will not work until you reboot the iPhone again.

References

Proxy Through iPhone https://developer.apple.com/documentation/watchos-apps/keeping-your-watchos-app-s-content-up-to-date#Test-your-update-code-with-different-configurations

Sample Code


struct ContentView: View {
    
    @State var txt = "Hello World!"
    
    var body: some View {
        VStack {
            Image(systemName: "globe")
                .imageScale(.large)
                .foregroundStyle(.tint)	
            
            Text(txt)
            
            Button("Click") {
                startLoad()
            }
        }.padding()
    }
    
    func startLoad() {
        let config = URLSessionConfiguration.default
        config.waitsForConnectivity = false
        config.allowsCellularAccess = true
        config.allowsExpensiveNetworkAccess = true
        config.allowsConstrainedNetworkAccess = true

        let sesh = URLSession(configuration: config)
        let url = URL(string: "https://www.example.com")!
        
        sesh.dataTask(with: url) { data, response, error in
            if let error = error {
                self.txt = error.localizedDescription
                // self.handleClientError(error)
                return
            }
            
            guard let httpResponse = response as? HTTPURLResponse,
                (200...299).contains(httpResponse.statusCode) else {
                self.txt = response.debugDescription
                // self.handleServerError(response)
                return
            }
            
            if let mimeType = httpResponse.mimeType, mimeType == "text/html",
                let data = data,
                let string = String(data: data, encoding: .utf8) {
                
                DispatchQueue.main.async {
                    self.txt = string
                    // self.webView.loadHTMLString(string, baseURL: url)
                }
            }
        }.resume()
    }
}

#Preview {
    ContentView()
}


Hello, thanks for all of the information in your post! The log you indicated typically means that they app does not have access to Cellular or Wi-Fi, which is a setting configured by a user. In this case, it sounds like that enforcement is happening unexpectedly. If possible, would you be able to install the sysdiagnose profile and follow the instructions to attach the sysdiagnose to a Feedback report? We'll need this logging from various other subsystems to have a better idea of what is going on here. Thanks!

Watch-Only and Independent apps have no network connection when paired with an iPhone (Network Proxy through iPhone)
 
 
Q