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?
Related
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
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
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
I'm trying to use Ensime to work with adnroid project generated with g8 (https://github.com/philcali/android-plugin). Followed this question I added the android.jar to my .ensime file. Here is it:
(:project-package "org.test"
:use-sbt t
:compile-jars ("~/_dev/_android/android-sdk-linux_x86/platforms/android-8/android.jar"))
Also i've got an exported ANDROID_SDK_HOME variable in my ~/.bashrc file.
But when i'm trying to start the ensime i'm getting this error:
java.lang.RuntimeException: Android SDK not found. You might need to set ANDROID_SDK_HOME or ANDROID_SDK_ROOT or ANDROID_HOME
at scala.Predef$.error(Predef.scala:58)
at AndroidPath$$anonfun$settings$8$$anonfun$apply$1.apply(AndroidPath.scala:21)
at AndroidPath$$anonfun$settings$8$$anonfun$apply$1.apply(AndroidPath.scala:21)
at scala.Option.getOrElse(Option.scala:104)
at AndroidPath$$anonfun$settings$8.apply(AndroidPath.scala:21)
at AndroidPath$$anonfun$settings$8.apply(AndroidPath.scala:20)
at sbt.Scoped$Apply$$anonfun$single$1.apply(Structure.scala:444)
at sbt.Scoped$Apply$$anonfun$single$1.apply(Structure.scala:444)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:44)
at sbt.Init$Apply.get(Settings.scala:223)
at sbt.Init$class.sbt$Init$$applySetting(Settings.scala:144)
at sbt.Init$$anonfun$compile$1$$anonfun$3$$anonfun$apply$2.apply(Settings.scala:100)
at sbt.Init$$anonfun$compile$1$$anonfun$3$$anonfun$apply$2.apply(Settings.scala:100)
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:123)
at scala.collection.immutable.List.foldLeft(List.scala:45)
at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:139)
at scala.collection.immutable.List.$div$colon(List.scala:45)
at sbt.Init$$anonfun$compile$1$$anonfun$3.apply(Settings.scala:100)
at sbt.Init$$anonfun$compile$1$$anonfun$3.apply(Settings.scala:100)
at sbt.Init$$anonfun$sbt$Init$$applyInits$1.apply(Settings.scala:140)
at sbt.Init$$anonfun$sbt$Init$$applyInits$1.apply(Settings.scala:140)
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:123)
at scala.collection.immutable.List.foldLeft(List.scala:45)
at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:139)
at scala.collection.immutable.List.$div$colon(List.scala:45)
at sbt.Init$class.sbt$Init$$applyInits(Settings.scala:140)
at sbt.Init$class.make(Settings.scala:92)
at sbt.Project$.make(Project.scala:102)
at sbt.Project$$anonfun$makeSettings$1.apply(Project.scala:177)
at sbt.Project$$anonfun$makeSettings$1.apply(Project.scala:177)
at sbt.Project$.translateCyclic(Project.scala:218)
at sbt.Project$.makeSettings(Project.scala:177)
at sbt.Load$.apply(Load.scala:120)
at sbt.Load$.defaultLoad(Load.scala:36)
at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:371)
at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:368)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:61)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:61)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:63)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:63)
at sbt.Command$.process(Command.scala:91)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:66)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:66)
at sbt.State$$anon$1.process(State.scala:59)
at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:66)
at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:66)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:13)
at sbt.MainLoop$.next(Main.scala:66)
at sbt.MainLoop$.run(Main.scala:61)
at sbt.xMain.run(Main.scala:33)
at xsbt.boot.Launch$.run(Launch.scala:54)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:43)
at xsbt.boot.Launch$.launch(Launch.scala:68)
at xsbt.boot.Launch$.apply(Launch.scala:14)
at xsbt.boot.Boot$.runImpl(Boot.scala:24)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)
I couldn't understand the reason why it happens. Does anybody have some thoughts about it? Thanks.
The solution is found! The answer is here: https://github.com/aemoncannon/ensime/issues/184#issuecomment-2038002:
The environment variables in .bashrc are only valid for programs
running in or are started from bash, otherwise you'll need .profile.
If you're using emacs: You could use M-x getenv to see if emacs can
see the environment variable. Use a (setenv "ANDROID_SDK_HOME"
"~/_dev/_android/android-sdk-linux_x86/") in your .emacs to set it for
every emacs session. But you probably already know this so I don't
know if this is of any help at all. Emacs sometimes seems to be tricky
to set up concerning environment vars.
Thanks to zilti!
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