diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index eb0a1712e92..b2e0768a652 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -92,6 +92,8 @@ #include #include +#include + #include #include #include @@ -1754,7 +1756,16 @@ void DebuggerPluginPrivate::attachToQmlPort() setConfigValue(_("LastQmlServerPort"), dlg.port()); setConfigValue(_("LastProfile"), kit->id().toSetting()); - sp.qmlServerAddress = sp.connParams.host; + IDevice::ConstPtr device = DeviceKitInformation::device(kit); + if (device) { + sp.connParams = device->sshParameters(); + if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE + || device->type() == Android::Constants::ANDROID_DEVICE_TYPE) { + sp.qmlServerAddress = QLatin1String("localhost"); + } else { + sp.qmlServerAddress = sp.connParams.host; + } + } sp.qmlServerPort = dlg.port(); sp.startMode = AttachToRemoteProcess; sp.closeMode = KillAtClose;