/wsl-eas-environment

Here will be all you need to set up a wsl environment (ubuntu) to run local builds using expo eas

Here will be all you need to set up a wsl environment (ubuntu) to run local builds using expo eas.

Requirements:

A linux environment;
Tools: 
  * Curl
Libs:
  * Node v16
  * NVM
  * Java v17
  * Git
  * Android-SDK
  * Android-SDK-build-tools
  * SDK Manager
  * Yarn

First step: configure your tools.

Curl

sudo apt install curl install it, and you good to go.



Second step: add the libs to your environment.

Advice:

If you notice any sort of error while using a command, you may run it as sudo.


Node

curl -s https://deb.nodesource.com/setup_16.x | sudo bash add NodeSource PPA.

sudo apt install nodejs -y install it.

node -v verify its version, it should be v16.


NVM

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash download it.

source ~/.bashrc complete your install.


Java

sudo apt-get update

sudo apt-get upgrade

sudo apt install openjdk-17-jdk openjdk-17-jre install.


Git

sudo apt update update the system package.

sudo apt install git install.

git --version verify its version.


Android-SDK.

sudo apt update

sudo apt install android-sdk install.


Android-SDK-build-tools.

sudo apt-get update

sudo apt-get -y install android-sdk-build-tools install.


SDK Manager.

sudo apt install sdkmanager install.

sdkmanager --version verify its version.


Yarn.

sudo npm install --global yarn install.

yarn --version verify its version.



Third step: finish configuring your environment and clone your project.

Configuring your environment

Now, let's configure the ANDROID_SDK_ROOT path, for that:

nano ~/.profile.

At the bottom of the file, insert export ANDROID_SDK_ROOT=/usr/lib/android-sdk.

Save it and exit.


The next step is to accept the sdkmanager licenses.

Run sudo chmod -R 777 /usr/lib/android-sdk/.

Now, just type sdkmanager --licenses and accept all of them.

Cloning your project

Feel free to add a folder for your project using mkdir your-folder-name if you want to.

git clone -b your-branch your-project-url -b is optional.

Then use your app passwords key to complete the download (if you're using bitbucket).

Inside your project folder, run the usual commands (like npm install).

Now, you are able to build your project: run eas build --profile your-profile-name --local.


Enjoy!.