Skip to content

Commit

Permalink
+ add codes for testing libidevice
Browse files Browse the repository at this point in the history
  • Loading branch information
hazmi-e205 committed Aug 5, 2023
1 parent c910999 commit 74efdd3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Src/devicebridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
#include <QDir>
#include <QSaveFile>

#include "idevice/instrument/dtxchannel.h"
#include "idevice/instrument/dtxconnection.h"
#include "idevice/instrument/dtxtransport.h"
#include "idevice/instrument/dtxmessage.h"
using namespace idevice;

bool DeviceBridge::m_destroyed = false;
DeviceBridge *DeviceBridge::m_instance = nullptr;
DeviceBridge *DeviceBridge::Get()
Expand Down Expand Up @@ -281,6 +287,18 @@ void DeviceBridge::StartServices()
return;
}
});

DTXTransport* transport = new DTXTransport(m_device);
DTXConnection* connection = new DTXConnection(transport);
connection->Connect();

std::shared_ptr<DTXChannel> channel = connection->MakeChannelWithIdentifier(
"com.apple.instruments.server.services.deviceinfo");
std::shared_ptr<DTXMessage> message = DTXMessage::CreateWithSelector("runningProcesses");
auto response = channel->SendMessageSync(message);
qDebug() << "response:";
qDebug() << response->PayloadObject()->ToJson().c_str();
channel->Cancel();
}

void DeviceBridge::StartLockdown(bool condition, QStringList service_ids, const std::function<void (QString&, lockdownd_service_descriptor_t&)> &function)
Expand Down

0 comments on commit 74efdd3

Please sign in to comment.