diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index 6a0779202b4..ffcd74b2be1 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -624,6 +625,21 @@ DeviceProcessSignalOperation::Ptr AndroidDevice::signalOperation() const return DeviceProcessSignalOperation::Ptr(new AndroidSignalOperation()); } +PortsGatheringMethod AndroidDevice::portsGatheringMethod() const +{ + return { + // Triggered for QmlProfiler + [this](QAbstractSocket::NetworkLayerProtocol protocol) -> CommandLine { + Q_UNUSED(protocol); + return {AndroidConfig::adbToolPath(), { + AndroidDeviceInfo::adbSelector(serialNumber()), + "shell" , "netstat", "-a", "-n" + }}; + }, + &Port::parseFromCommandOutput + }; +} + QUrl AndroidDevice::toolControlChannel(const ControlChannelHint &) const { QUrl url; diff --git a/src/plugins/android/androiddevice.h b/src/plugins/android/androiddevice.h index a5f4997dbd4..7896fbc9705 100644 --- a/src/plugins/android/androiddevice.h +++ b/src/plugins/android/androiddevice.h @@ -59,6 +59,7 @@ private: ProjectExplorer::IDeviceWidget *createWidget() override; ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override; QUrl toolControlChannel(const ControlChannelHint &) const override; + ProjectExplorer::PortsGatheringMethod portsGatheringMethod() const override; QSettings *avdSettings() const; void initAvdSettings();