How to run adb exec-out command using com.android.ddmlib.IDevice?

Viewed 162

I need to execute an adb exec-out command using the com.android.ddmlib.IDevice but I was only able to run adb shell commands. Is it possible to execute that using this class? Otherwise I would need to run the adb as a Proccess but I'm trying to avoid that.

Here is how I usually run adb shell commands

fun runCommand(device: IDevice, command: String): String {
    val outputReceiver = CollectingOutputReceiver()
    // How to run adb/adb exec-out commands instead (not shell)?
    device.executeShellCommand(command, outputReceiver)
    return outputReceiver.output
}

Thanks!

0 Answers
Related