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

AstonJ
This blog post hit my timeline earlier, and I’ve also been learning about some fantastic Elixir related tips via @pragdave’s new online c...
New
marcelo
I wrote a small article on how to use current_user with coherence on Phoenix. There are already a couple of blogposts about it but I thin...
New
OvermindDL1
Ran across this recently, it’s a set of cheatsheet inforgraphic things of the OTP behaviours on the BEAM: https://github.com/Telichkin/o...
New
f0rest8
Hi, TLDR: form attribute set on the input fields and button submit. I just wanted to share a solution I discovered when making live inl...
New
sergio
Hey there, we’re going to walk through deploying a Phoenix app to a DigitalOcean droplet, manually - no tools no nothing. Just straight u...
New
crockwave
To integrate dropdown menus in a Phoenix Liveview app, you can use a combination of js, Hooks, CSS and your .leex and .ex code. You can...
New
jshprentz
Geoffrey Lessel’s 2019 book, Phoenix in Action, was written for Phoenix 1.4. I found that the book’s code examples did not match the cur...
New
smpallen99
Some advice for Elixir programmers. I was reviewing someone’s Elixir Code yesterday and found a deadlock condition bug in a GenServer im...
New
mhanberg
Hi! I recently finished adding authentication to my Phoenix API, so I wanted to share what I learned. I haven’t created authentication f...
New
dogweather
I just finished a long process of configuring and debugging a Docker Compose-based dev environment. Several late-night hours! I think I’v...
New

Other popular topics Top

AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39297 209
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement