由于以下错误,我无法再在Visual Code中调试Ionic应用程序:“无法与目标进行通信”。仅在iOS设备上会发生此问题。 Android运行正常。
启用了设备上Safari的“高级”设置中的Web检查器。我还尝试过重新安装ios-webkit-debug-proxy和ideviceinstaller和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中的配置是:
{
"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 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
我在终端中手动运行ios-webkit-debug-proxy:
Listing devices on :9221
Connected :9222 to Test (b78b701f3f1cca9a1177271de27916f4fc53c00a)
然后我开始调试过程。 错误是:
Attaching to ios
Configuring debugging proxy
Unable to communicate with target