Thursday, March 11, 2010

Make SDK tools easy to access

This is not required but highly recommended. You may not need it now but you will need it if you want to use your phone to test your apps in.

Some useful Android SDK tools are accessible through the command prompt(Terminal)

Normally, you will need to navigate to your Android SDK file before you could use any of SDK's commands. And you will need to do that every time you open the command prompt. This will become annoying specially when there are some files you want to send them to the phone or the emulator.

There is a way to access SDK tools no matter what directory you are in and here is how to do it:
Remember, you must memorize where did you unpack Android-sdk.
[your sdk directory goes here] should be replaced with your Android-sdk directory.

Linux:
  • open bash resource file (its either ~/.bash_profile or ~/.bashrc)
  • look for PATH= and change it to
    export PATH=${PATH}:[your sdk directory goes here]/tools
    or add it into the end of the file if you did not find.
Mac:
  • Do the same as Linux except that the bash resource file is .bash_profile and if it is not in the home directory, then you will need to create a new one.
Windows:
  • right-click on My Computer > Properties > Advanced [tab] > Environment Variables
  • double-click on Path > (under System Variables) and add:
    [your sdk directory goes here]/tools
Done! to sure, open the command prompt and type adb (Android Debug Bridge)
Remember, Linux and Mac are case sensitive.

No comments:

Post a Comment