mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 03:25:02 +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)
|
||||
{
|
||||
QStringList adbArgs;
|
||||
|
|
|
@ -28,6 +28,7 @@ public:
|
|||
void install(const QString& serial, const QString& local);
|
||||
void removePath(const QString& serial, const QString& path);
|
||||
bool isRuning();
|
||||
void setShowTouchesEnabled(const QString& serial, bool enabled);
|
||||
|
||||
static const QString& getAdbPath();
|
||||
|
||||
|
|
|
@ -25,10 +25,12 @@ void Dialog::on_adbProcess_clicked()
|
|||
{
|
||||
AdbProcess* adb = new AdbProcess();
|
||||
connect(adb, &AdbProcess::adbProcessResult, this, [this](AdbProcess::ADB_EXEC_RESULT processResult){
|
||||
Q_UNUSED(processResult);
|
||||
sender()->deleteLater();
|
||||
if (AdbProcess::AER_SUCCESS_START != processResult) {
|
||||
sender()->deleteLater();
|
||||
}
|
||||
});
|
||||
adb->execute("", QStringList() << "devices");
|
||||
//adb->setShowTouchesEnabled("P7C0218510000537", true);
|
||||
}
|
||||
|
||||
void Dialog::on_startServerBtn_clicked()
|
||||
|
@ -45,9 +47,3 @@ void Dialog::on_stopServerBtn_clicked()
|
|||
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();
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
|
||||
private:
|
||||
Ui::Dialog *ui;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue