I can no longer debug the Ionic application in Visual Code because of this error: “Unable to communicate with target”. This issue only occurs on iOS device. Android works fine.
Web Inspector from Safari’s Advance settings on device is enabled. I’ve also tried to reinstall ios-webkit-debug-proxy and ideviceinstaller and usbmuxd.
brew uninstall ios-webkit-debug-proxy
brew uninstall ideviceinstaller
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
brew install ios-webkit-debug-proxy
launch.json configuration is:
{
"name": "Attach to running iOS on device",
"type": "cordova",
"request": "attach",
"platform": "ios",
"target": "device",
"port": 9222,
"sourceMaps": true,
"cwd": "${workspaceRoot}",
"attachAttempts": 5,
"attachDelay": 5000
}
ionic info
Ionic CLI : 5.1.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.10
Cordova:
Cordova CLI : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-webview 1.2.1, (and 22 other plugins)
Utility:
cordova-res : 0.3.0 (update available: 0.5.1)
native-run : 0.2.5 (update available: 0.2.7)
System:
ios-deploy : 1.9.4
NodeJS : v10.15.0 (/usr/local/bin/node)
npm : 6.9.0
OS : macOS High Sierra
Xcode : Xcode 10.1 Build version 10B61
I run ios-webkit-debug-proxy manually in terminal:
Listing devices on :9221
Connected :9222 to Test (b78b701f3f1cca9a1177271de27916f4fc53c00a)
And then I start debug process. The error is:
Attaching to ios
Configuring debugging proxy
Unable to communicate with target