Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Woodcrest64

macrumors 65816
Original poster
Aug 14, 2006
1,334
570
What do I type in terminal to run an application followed by a command to do something with that app? I want to do this with a single command line.

Like OPEN 'appication' ADB with the command 'reboot bootloader'
 
You can use the 'open' command. Type in 'man open' in the Terminal (without the single quotes) to get info about the 'open' command in general. It will also show examples towards the end of the help file.

If it's something complicated you want to do, you might want to create an Apple Script to do whatever you want in the program, then use the Terminal 'open' command to open the script itself.
 
Not sure what's complicated about this. 'adb' is a command-line utility. Open the Terminal shell. Type:

Code:
adb reboot bootloader

Assuming adb is in your path, it will work.
 
Solved!

Thanks for the replies. I got my answer.

I have to use the following command because adb isn't installed as a bash command if that makes any sense. If I don't use ./adb then I get an error message saying 'command not found'

./adb reboot bootloader

The ' ./ ' is need assuming adb isn't correctly installed as a bash command I believe but the command MUST be used in the same directory as where the app installed.
 
No, you're not required to be in the same directory where the app is installed. Your issue is that the directory with the adb executable isn't in your shell's PATH variable. You have a couple options:

1. Modify the PATH variable to include the directory where the adb executable is.
2. Add an alias to adb.

Given that you don't have a lot of experience using the shell, my guess is that option 2 is probably easier for you.

Code:
alias adb=/full/path/to/adb

To find the full path, you can 'cd' to the directory where adb is and type 'pwd' which will give you the path to the directory.

Then you can use the 'adb' command in whatever directory you are in. When you use './adb', you are fully specifying the path to the adb command. "./" means "the current directory".
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.