Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Want script to open terminal

Want script to open terminal

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jocala
    wrote on last edited by
    #1

    I'm doing a program (OS X) that needs to open a terminal then issue a command:

    "adb -s ipaddress:5555 shell" where the ipaddress is variable depending on what android device is connected. Terminal.app can't accept arguments, so I'm trying a bash script:

    @
    #!/bin/bash
    /Applications/adbfire/adb -s $1 shell
    @

    qt code:

    @
    daddr = "192.168.1.1:5555"
    cstring = "/Applications/adbFire/startadb.command";
    QProcess::startDetached(cstring,QStringList() << daddr);
    @

    I need the startDetached to open a terminal, then run the code. Now it sends activity to Application output. Can I make startDetached act as if I double-clicked the file: open a term to run it?

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      You are trying start two external process at a time. You can try the following.

      1. Use the 'system' api to start the external command. Try whether this helps.
      2. You can start the external process as terminal. This process is treated like I/O device. Redirect the stdin/out of external process and write what you want from Qt process.

      See if any of these help you.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jocala
        wrote on last edited by
        #3

        Thanks, I'll try this out.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved