Xcode Simulator cannot connect Wi-Fi AP

I want to make the simulator device connect to the Wi-Fi AP using the code below.

let wifiConfiguration = NEHotspotConfiguration(
            ssid: appDelegate.SSID,
            passphrase: appDelegate.Pwd,
            isWEP: false)

Of course, the following code was executed before trying to connect.

locationManager.requestWhenInUseAuthorization()

However, the connection fails with the error below.

2023-04-05 15:53:22.366259+0900 WiFiProvisioning[6316:80203] [] Failed to send a 9 message to nehelper: <dictionary: 0x1b44293f0> { count = 1, transaction: 0, voucher = 0x0, contents =
	"XPCErrorDescription" => <string: 0x1b4429588> { length = 18, contents = "Connection invalid" }
}
2023-04-05 15:53:22.366606+0900 WiFiProvisioning[6316:80203] [] NEHotspotConfigurationHelper failed to communicate to helper server.

When I install the app on my real iPhone device, it connects to the AP.

The version information is as follows.

  • Mac PC chip : Apple M1 Pro
  • macOS : Ventura 13.3
  • Xcode : 14.3
  • Simulator iOS : 16.4
  • My iPhone iOS : 16.4

The applied capabilities are as below.

<key>com.apple.developer.networking.HotspotConfiguration</key>
	<true/>
	<key>com.apple.developer.networking.networkextension</key>
	<array>
		<string>content-filter-provider</string>
	</array>
	<key>com.apple.developer.networking.wifi-info</key>
	<true/>
	<key>com.apple.external-accessory.wireless-configuration</key>
	<true/>

I want to make the simulator device connect to the Wi-Fi AP using the code below.

This won’t work. The simulator uses the macOS networking stack and so Network Extension technologies simply don’t work in that environment. You’ll need to test on a real device.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Xcode Simulator cannot connect Wi-Fi AP
 
 
Q