mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-03 14:18:45 +00:00
解决adb devices crash问题
This commit is contained in:
parent
aac1fa3fea
commit
c0015b4f63
4 changed files with 13 additions and 11 deletions
|
@ -97,6 +97,14 @@ bool AdbProcess::isRuning()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AdbProcess::setShowTouchesEnabled(const QString &serial, bool enabled)
|
||||||
|
{
|
||||||
|
QStringList adbArgs;
|
||||||
|
adbArgs << "shell" << "settings" << "put" << "system" << "show_touches";
|
||||||
|
adbArgs << (enabled ? "1" : "0");
|
||||||
|
execute(serial, adbArgs);
|
||||||
|
}
|
||||||
|
|
||||||
void AdbProcess::forward(const QString& serial, quint16 localPort, const QString& deviceSocketName)
|
void AdbProcess::forward(const QString& serial, quint16 localPort, const QString& deviceSocketName)
|
||||||
{
|
{
|
||||||
QStringList adbArgs;
|
QStringList adbArgs;
|
||||||
|
|
|
@ -28,6 +28,7 @@ public:
|
||||||
void install(const QString& serial, const QString& local);
|
void install(const QString& serial, const QString& local);
|
||||||
void removePath(const QString& serial, const QString& path);
|
void removePath(const QString& serial, const QString& path);
|
||||||
bool isRuning();
|
bool isRuning();
|
||||||
|
void setShowTouchesEnabled(const QString& serial, bool enabled);
|
||||||
|
|
||||||
static const QString& getAdbPath();
|
static const QString& getAdbPath();
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,12 @@ void Dialog::on_adbProcess_clicked()
|
||||||
{
|
{
|
||||||
AdbProcess* adb = new AdbProcess();
|
AdbProcess* adb = new AdbProcess();
|
||||||
connect(adb, &AdbProcess::adbProcessResult, this, [this](AdbProcess::ADB_EXEC_RESULT processResult){
|
connect(adb, &AdbProcess::adbProcessResult, this, [this](AdbProcess::ADB_EXEC_RESULT processResult){
|
||||||
Q_UNUSED(processResult);
|
if (AdbProcess::AER_SUCCESS_START != processResult) {
|
||||||
sender()->deleteLater();
|
sender()->deleteLater();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
adb->execute("", QStringList() << "devices");
|
adb->execute("", QStringList() << "devices");
|
||||||
|
//adb->setShowTouchesEnabled("P7C0218510000537", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dialog::on_startServerBtn_clicked()
|
void Dialog::on_startServerBtn_clicked()
|
||||||
|
@ -45,9 +47,3 @@ void Dialog::on_stopServerBtn_clicked()
|
||||||
m_videoForm->close();
|
m_videoForm->close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dialog::keyPressEvent(QKeyEvent *event)
|
|
||||||
{
|
|
||||||
qDebug() << event->key();
|
|
||||||
return QDialog::keyPressEvent(event);
|
|
||||||
}
|
|
||||||
|
|
|
@ -26,9 +26,6 @@ private slots:
|
||||||
|
|
||||||
void on_stopServerBtn_clicked();
|
void on_stopServerBtn_clicked();
|
||||||
|
|
||||||
protected:
|
|
||||||
void keyPressEvent(QKeyEvent *event);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::Dialog *ui;
|
Ui::Dialog *ui;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue