Problem in setting path for android sdk in ubuntu - android

export PATH=${/home/mohit/}:<android-sdk-linux_86>/tools
this is what i am using..
error:--
bash: PATH=${/home/mohit/}:: bad substitution
this is the path of sdk
mohit#mohit-laptop:~/android-sdk-linux_86$ pwd
/home/mohit/android-sdk-linux_86

Typically you will use
export PATH=${PATH}:<added path here>
try that, to append to your $PATH variable, or just remove the ${} and set it directly, if you wish to replace it. Also keep in mind, this change is not permanent unless you add this to your .bashrc or .bash_profile or equivalent scripts. You can reload them with the
source .bash_profile
command without having to re-login.

The problem is that ${/home/mohit/} is actually treating /home/mohit/ as a variable and attempting to dereference it. My guess is that what you really wanted to do was:
export PATH="$PATH":"$HOME/android-sdk-linux_86/tools"

You can edit your /etc/profile to add the path you need.
Like this:
JAVA_HOME=/opt/jdk1.6.0_30
CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export JAVA_HOME
export CLASSPATH
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
It is global.

You can maintain a script file under /etc/profile.d/ and we can use it as global

Related

ERROR android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ..\emulator\lib64\qt\lib Could not launch 'C:\Users: No such file or directory

I am trying to work with the native native for a school project, but when executing the following command in cmd: emulator -version he returned this error to me:
[4640]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ..\emulator\lib64\qt\lib
Could not launch 'C:\Users\gusta..\emulator\qemu\windows-x86_64\qemu-system-i386.exe': No such file or directory
already changed the path in several ways and I think the problem is not this so if someone can help me grateful
There are two emulator executables in the sdk (as of now):
sdk/tools/emulator
sdk/emulator/emulator
The emulator executable has to be added in the PATH variable, in a way so that
sdk/emulator/emulator comes before sdk/tools/emulator
Do this to solve the error:
Edit the system environment variables
Make sure you have set user variable for ANDROID_HOME
Remove any variable /path/to/android-sdk/tools from user and system environment variable.
Save and exit
To resolve this error:
Your system variables should look like below:
“C:\Users\username\AppData\Local\Android\Sdk” -ANDROID_HOME
“C:\Users\username\AppData\Local\Android\Sdk\tools\bin” -PATH
“C:\Users\username\AppData\Local\Android\Sdk\platform-tools” -PATH
“C:\Users\username\AppData\Local\Android\Sdk\emulator” - PATH
“C:\Users\username\AppData\Local\Android\Sdk\tools" -PATH
This worked for me.
Based on the answer of IronBlossom.
On mac these are the important environment variables that need to be adjusted.
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
Make sure that emulator comes before tools

Can't add multiple enviorment paths in osx

I am trying to add multiple environment paths in OSX for Grails and Android.
Here is what my .bash_profile looks like
export GRAILS_HOME=/Users/jon/Downloads/grails-2.4.0
export PATH=$PATH:$GRAILS_HOME/bin
export PATH = ${PATH}:/Users/jon/Library/Android/sdk/tools
export PATH = ${PATH}:/Users/jon/Library/Android/sdk/platform-tools
echo path shows this output:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jon/Downloads/grails-2.4.0/bin
Android doesn't seem to get added?
Remove space around the = sign and remove {} arount the PATH variable and change those lines like:
export PATH=$PATH:/Users/jon/Library/Android/sdk/tools
export PATH=$PATH:/Users/jon/Library/Android/sdk/platform-tools

.bash_profile wrecks my PATH, but .bashrc

i've been using .bashrc (happily) for a long time, but when i tried to add
export PATH="/Users/sam/bin/android-sdk-macosx/platform-tools/" to my path, it wouldn't work... i figured i'd add it to a .bash_profile file, but whenever i run my terminal with .bash_profile, no commands work not ls and none of the commands i put in my .bash_profile path.
i would continue to use .bashrc, but another script (one that i shouldn't edit) uses adb, and i can't get .bashrc to see it for some reason.. (adb is in /Users/sam/bin/android-sdk-macosx/platform-tools/
what should i do?
You have to add the /Users/.../ path to your already existing $PATH
export PATH="${PATH}:/Users/sam/bin/android-sdk-macosx/platform-tools/"
Your command says the $PATH variable will only be 1 "folder" /Users/.... But $PATH is in fact already defined and used. So you have to concatenate the new "folder" to the list of folders in $PATH. If you do echo $PATH you will see this list.
If you want to add more than 1 path, you can still do that in one expression:
export PATH="${PATH}:/Users/sam/bin/android-sdk-macosx/platform-tools/:/Users/sam/bin/:/a/third/addition/"
It seems like you are completely overriding the value of PATH. By default PATH contains references to the binary files, which includes the commands. As you are forcing the value of PATH without preserving the current value your terminal is not finding any other than
"/Users/sam/bin/android-sdk-macosx/platform-tools/"
When modifying the path variable it's recommended to do it in the next way - at least you are sure that the forced value won't break the shell:
PATH=$PATH:New_Reference # Colon is the separator of the values
export PATH

Environment path set to "PATH" variable missing after system restart?

I have set
export PATH=$PATH:/home/user/android-sdk-linux/platform-tools
and execute the above line in command line and later if I type echo $PATH, I could see the path added. But after restarting the system I couldn't see it any more. But putting the system to sleep and then starting again, I could still see it. How to resolve the issue?
Adding it using export on command line would just set it for the current session.To set it permanently you need to add it to .bashrc or /etc/profile.
Your question is similar to:
How to permanently export a variable in Linux?

How to add android tools dir to windows 7 path?

I like to quickly start hierarchyviewer. At the moment i use the prompt to go navigate to .... \AppData\local\android\android-sdk\tools\ and then hierarchyviewer
I think i need to add something to windows 7 path, but i don't know what to do exactly.
Any suggestions?
regards
Suppose you have download and install Android SDK, and extract it in some drive. There are two methods to set PATH:
Use command prompt :
set path=%path%;D:\android-sdk-windows\tools;
Another is follow these steps :
My Computer->Property->Advanced->Environment Variables->Edit Path Variable and add “D:\ android-sdk-windows\tools” into the Path Variables.
In your computer properties-advance-environment variables-system variable ,and you find variable "path", add your android/tools path in it.
The operate like add java.exe in you computer path
C:\Users\user\AppData\Local\Android\Sdk\tools\bin
and add it you your Path User variable

Categories

Resources