1. Check out our app, Forums for Android! Download and leave feedback here!

Send Command Line to PC

Discussion in 'Android Apps & Games' started by tberman333, Jul 26, 2010.

  1. tberman333

    tberman333 Member
    Thread Starter
    5

    Jan 3, 2010
    5
    0
    5
    Does anyone know if there is an application that will send command lines to a PC? I would like to use this to either both launch programs and send other commands (such as changing the audio output on my PC).

    I am able to do this by creating shortcuts to the commands, then using a remote program (like premotedroid) to control the mouse and click the shortcuts, but it would be really cool if the phone could just send the command directly to the PC.

    Any thoughts on how to do this would be great.

    Thanks!
     

    Advertisement

  2. Is this on linux, mac or windows? I have a lot of phone<->PC stuff set up for linux using ssh which I can help you set up, but I wouldn't know where to start with anything other than linux.
     
  3. tberman333

    tberman333 Member
    Thread Starter
    5

    Jan 3, 2010
    5
    0
    5
    I am actually looking to do this on a Windows machine now, but could see the need to do it on a Linux server I have setup at some point. If you can give me a brief tutorial on how you sent a command to a linux box, I may be able to transfer that to Windows.

    Thanks!
     
  4. Well, ssh only works between two command lines, but OpenSSH is available for Windows, so I don't see why you couldn't run it, login and execute your shortcuts, as long as they can be executed from the windows command line.

    For Linux, all you need to do is run ssh on the computer then you can login by running this from the command line:

    ssh user@ip_address

    (I suggest running ssh on a random port other than 22, 13579 for example. Just add "-p" to all of these like: "ssh user@ip_address -p 13579")

    That requires you to type in your password. To login without a password, you have to set up ssh keys, then you can use a command like this:

    ssh user@ip_address -i /path/to/ssh/key

    (The ssh key is the one on the phone). When you use that, it just automatically logs you in to the computer.

    But what you probably want is to be able to run a command without really logging in, which you can do like this:

    ssh user@ip_address -i /path/to/ssh/key 'commands'

    That's like a semi-login. It authenticates, runs the commands and gives output but doesn't give you a shell that you have to log out of. You can use it in scripts and do all kinds of cool things and it can connect from anywhere. I run things on my computer from the couch, from work, or while riding down the road.

    I have a blog of various command line things, a lot of which use ssh, here. It may be nothing you're interested in, but it would have a few examples if you were to set it up.
     
    tberman333 likes this.
  5. bluenova

    bluenova OK Computer
    143

    Jan 11, 2010
    1,617
    243
    143
    Driver
    W Midlands, UK
    I use ConnectBot, it's a great little app. You can use SSH or Telnet.
     
    tberman333 likes this.
  6. sitlet

    213

    Apr 11, 2010
    5,867
    633
    213
    Yo can use a remote desktop app, like Remote Desktop or Phone My PC. PhoneMYPC also has a command line executer, so you like the program on your pc to shortcuts of commands, and then can run them without actually typing them out on teh phone.
     
    tberman333 likes this.

Share This Page

Loading...