bitli

bitli

Instructions to run Elixir on Android

In case this is handy for other people, here is how you can run Elixir on Android:

  • Install https://termux.com/
  • apt update; apt upgrade to have your system up to date.
  • Install Erlang with apt install erlang, you should be able to run erl.
  • (check if an Elixir package was created so you can avoid the trouble of the remaining lines :slight_smile: )
  • Install wget with apt install wget (otherwise you will get bad address on any wget request).
  • Create a directory, and cd to it, for example: mkdir elixir; cd elixir.
  • Download the precompiled package from the link named Precompiled.zip file for the latest release in the page http://elixir-lang.org/install.html#precompiled-package.At time of this writing the command wget https://github.com/elixir-lang/elixir/releases/download/v1.4.2/Precompiled.zip should do this.
  • Unzip the files with unzip Precompiled.zip.
  • Go to directory bin.
  • Download the file termux-fix-shebang from the source at https://raw.githubusercontent.com/termux/termux-packages/master/packages/termux-tools/termux-fix-shebang. You can use wget https://raw.githubusercontent.com/termux/termux-packages/master/packages/termux-tools/termux-fix-shebang.
  • Execute sh termux-fix-shebang elixir iex elixircin the bin directory (sh is required as the path of the shebang of the script is not compatible with termux).
  • Execute which env and edit the first line of mix to set the path of command envto the one found by the command which.
  • Add export PATH=$PATH:$HOME/elixir/bin to your .bashrc or execute the command on your terminal.
    You can then mix and iex. An Android phone is not exactly a convenient development platform, but it was useful to me to learn Elixir when waiting for whatever.

Most Liked

soyjeansoy

soyjeansoy

here’s what i did (assuming you’re using termux):

  1. pkg install erlang
  • easiest way to install elixir is to use asdf-vm.
  1. git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.1

  2. Next do the following (im using zsh):

echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
  1. restart termux session
  2. asdf plugin-add elixir
  3. asdf install elixir 1.8.1 or to find a version you can: asdf list-all elixir
  4. asdf global elixir 1.8.1 to set this version globally

you can visit their page on how to install asdf-vm.

happy coding!

NobbZ

NobbZ

Please try apt install --yes wget, for the older interface to apt, that meant to not ask but assume the operator knows what he is doing and install/remove everything. Can’t check though if it is still valid on the new interface which is used by termux.

PatNowak

PatNowak

Termux is awesome, but you might inform at the top of the post that this is the guide only for Android 5.0 and above. Thanks for the guide! :slight_smile:

Where Next?

Popular in Guides/Tuts Top

dgamidov
Hi folks, Just a short instruction. Maybe it will help somebody. Install boostrap with deps and Sass: cd assets npm install jquery ...
New
sergio
https://sergiotapia.me/generate-images-with-name-initials-using-elixir-and-imagemagick-374eca4d14ff Hope this saves you guys some time!...
New
fmcgeough
pipe into case? I use that fairly frequently…unless I’m misunderstanding what you’re wanting…could be.. its still very early… str = "Hel...
New
siever
I just wrote a simple guide on how you can setup a productive elixir development environment in vim. Its really easy, just a few steps. ...
New
marcin
This post is intended to be a guide for others, I was running a remote debugger for the first time and appreciate feedback on how I could...
New
Jskalc
Sorry if it’s a common knowledge, but it’s something I just learned and wanted to share. I’ve seen that mind-blowing demo of hot-reload ...
New
tonydang
I recently got inertia-phoenix (an Inertia.js adapter for Phoenix) working with Svelte. Setting up the server-side rendering (SSR) with S...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 55125 245
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44778 311
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement