Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Create terminal command shortcut icon

Hello,


If someone would be kind enough to help me out with creating a shortcut terminal command that would be great. I was messing around with the Android SDK just for fun and was wondering how you can get it to launch a specific avd, so from Terminal I would type


/user/myaccount/applications/andriod/tools/emulator -avd Android-2.3.3


And it would open, how would you create a shortcut on the desktop to do this so I can just double click and it will open? In windows I would just modify the target and add the -avd or create a batch file, but not sure how to do this in OSX.


Thanks

MacBook Pro, Mac OS X (10.6.7)

Posted on Jul 13, 2011 9:49 AM

Reply
7 replies

Feb 7, 2017 1:06 PM in response to VAsHachiRoku

I spent a fair amount of time trying to create shell scripts and to try to get Automator to simply do anything useful. What I'm using now is Shuttle by Fitztrev on github. https://github.com/fitztrev/shuttle Your biggest skillset would be to be able to use his editor to edit the JSON configuration file. But honestly, that was easy enough. You end up with a new icon on the top menu. Clicking this gives you menu items which then run whatever it is you need to do.

Jul 14, 2011 6:28 AM in response to kaz-k

so in text editor I put this line which if I open terminal and paste it will launch the emulator.


/Applications/Android-Emulator/tools/emulator -avd Android-2.3.3


saved the file, then did a chmod +x ./filename


change the extention to .command


When I double click I get an error


Last login: Thu Jul 14 21:24:12 on ttys000

/Users/Me/Desktop/Android.command ; exit;

MacBook-Pro:~ me$ /Users/Me/Desktop/Android.command ; exit;

/Users/me/Desktop/Android.command: line 1: {rtf1ansiansicpg1252cocoartf1038cocoasubrtf360: command not found

/Users/me/Desktop/Android.command: line 2: syntax error near unexpected token `}'

/Users/me/Desktop/Android.command: line 2: `{\fonttbl\f0\fswiss\fcharset0 Helvetica;}'

logout

Jul 14, 2011 8:30 PM in response to Topher Kessler

I would think Topher's solution would be the best option.

You could even create Service that accepts files in the Finder.

The next action would be the do shell script action.

Set the script to pass the input as arguments.

Set the script to:

/user/myaccount/applications/andriod/tools/emulator -avd "$1"

Name it something like "Open avd"


Then, you can right-click on any avd file and choose the service you created.


My assumption is you might have multiple avd files (or it will have an updated version). Then, you don't have to change the application to pick a new file.

Create terminal command shortcut icon

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.