Run a command in a new window using IDEA Ant

In IntelliJ IDEA, I have this task in my Ant script

<target name="emulator-logcat">
    <exec command="adb" spawn="false" osfamily="windows">
        <arg value="-e"/>
        <arg value="shell"/>
        <arg value="logcat"/>
    </exec>
</target>

It works, but the command output is sent to the IDEA Ant window, and not to the Windows console window. How can I redirect the output of a command to a new windows window, as if I started this command from cmd.exe?

+3
source share
1 answer

Solution: I create the runner.batwitch file contains %*and call it like this:

<target name="emulator-logcat">
    <exec command="cmd.exe" spawn="true" osfamily="windows">
        <arg line="/c start runner.bat adb -e shell logcat"/>
    </exec>
</target>
+2
source

Source: https://habr.com/ru/post/1793238/


All Articles