Forked from samuelyee/Ionic Android Development on WSL2.md
Created
August 14, 2024 01:30
-
-
Save trickpattyFH20/1afb3f1f9c3b00c0968ecdb3f9422565 to your computer and use it in GitHub Desktop.
Revisions
-
samuelyee revised this gist
Sep 25, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,7 @@ cd ~ sudo apt update sudo apt upgrade # Replace bash if you are using other shells e.g. zsh curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash nvm install --lts nvm use --lts -
samuelyee revised this gist
Sep 25, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,6 +34,7 @@ tar xfv $(ls -1t $HOME/Downloads/android-studio-* | head -n1) Note: you can get an updated Android Studio link from https://developer.android.com/studio/#downloads ## Install Android SDK and Tools using Android Studio Run the Android Studio and install the necessary tools with the GUI wizard > $HOME/Applications/android-studio/bin/studio.sh ## Adding the Android SDK to your PATH -
samuelyee revised this gist
Sep 25, 2022 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,6 +51,11 @@ export PATH sudo apt install qemu-kvm sudo adduser $USER kvm ``` Create a new file `/etc/wsl.conf` with the following content: ``` [boot] command = /bin/bash -c 'chown root:kvm /dev/kvm && chmod 660 /dev/kvm' ``` Reboot your machine. # Open Android Studio -
samuelyee revised this gist
Sep 25, 2022 . 1 changed file with 12 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,6 +23,7 @@ git config --global core.autocrlf input sudo apt-get update sudo apt install openjdk-11-jdk ``` ## Downloading Android Studio ``` mkdir -p $HOME/Downloads && cd "$_" @@ -38,14 +39,24 @@ Note: you can get an updated Android Studio link from https://developer.android. ## Adding the Android SDK to your PATH Add the following to your `.profile` (or `.zshrc` if you use zsh): ``` # Add Android SDK to PATH export ANDROID_SDK_ROOT=$HOME/Android/Sdk export CAPACITOR_ANDROID_STUDIO_PATH=$HOME/Applications/android-studio PATH="$HOME/Applications/android-studio/bin:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/emulator:$PATH" export PATH ``` ## Install VM Emulator ``` sudo apt install qemu-kvm sudo adduser $USER kvm ``` Reboot your machine. # Open Android Studio - Run `ionic cap add android` for new project - Run `ionic cap sync android` for existing project - Run `ionic cap open android` - If `ionic cap open android` could not work, use `studio.sh android &` instead -
samuelyee revised this gist
Sep 25, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,7 +39,7 @@ Note: you can get an updated Android Studio link from https://developer.android. Add the following to your `.profile` (or `.zshrc` if you use zsh): ``` # Add Android SKD to PATH export ANDROID_SDK_ROOT=$HOME/Android/Sdk export CAPACITOR_ANDROID_STUDIO_PATH=$HOME/Applications/android-studio PATH="$HOME/Applications/android-studio/bin:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/emulator:$PATH" export PATH -
samuelyee revised this gist
Sep 25, 2022 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ # Ionic Android Development on WSL2 This setup is assuming that [GUI Linux apps can run in your WSL2](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps). ## Installing the required software Execute the following commands to install Node, npm, git, Java, Ionic CLI: @@ -43,4 +44,8 @@ export CAPACITOR_ANDROID_STUDIO_PATH=$HOME/Applications/android-studio PATH="$HOME/Applications/android-studio/bin:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/emulator:$PATH" export PATH ``` # Open Android Studio - Run `ionic cap add android` for new project - Run `ionic cap sync android` for existing project - Run `ionic cap open android` - If `ionic cap open android` could not work, use `studio.sh android &` instead -
samuelyee revised this gist
Sep 25, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,9 +29,9 @@ wget https://r2---sn-npoe7nss.gvt1.com/edgedl/android/studio/ide-zips/2021.3.1.1 mkdir -p $HOME/Applications && cd "$_" tar xfv $(ls -1t $HOME/Downloads/android-studio-* | head -n1) ``` Note: you can get an updated Android Studio link from https://developer.android.com/studio/#downloads ## Install Android SDK and Tools using Android Studio > $HOME/Applications/android-studio/bin/studio.sh ## Adding the Android SDK to your PATH -
samuelyee revised this gist
Sep 25, 2022 . 1 changed file with 4 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # Ionic Android Development on WSL2 ## Installing the required software Execute the following commands to install Node, npm, git, Java, Ionic CLI: ``` cd ~ @@ -12,18 +12,17 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash nvm install --lts nvm use --lts npm install -g @ionic/cli sudo apt install git git config --global user.email "you@yourmail.com" git config --global user.name "Your Name" git config --global core.autocrlf input sudo apt-get update sudo apt install openjdk-11-jdk ``` ## Downloading Android Studio ``` mkdir -p $HOME/Downloads && cd "$_" wget https://r2---sn-npoe7nss.gvt1.com/edgedl/android/studio/ide-zips/2021.3.1.16/android-studio-2021.3.1.16-linux.tar.gz @@ -44,6 +43,4 @@ export CAPACITOR_ANDROID_STUDIO_PATH=$HOME/Applications/android-studio PATH="$HOME/Applications/android-studio/bin:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/emulator:$PATH" export PATH ``` If `ionic cap open android` could not work, use `studio.sh android &` instead -
samuelyee revised this gist
Sep 25, 2022 . 1 changed file with 8 additions and 47 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,57 +32,18 @@ tar xfv $(ls -1t $HOME/Downloads/android-studio-* | head -n1) ``` Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads ## Install SDK using Android Studio > $HOME/Applications/android-studio/bin/studio.sh ## Adding the Android SDK to your PATH Add the following to your `.profile` (or `.zshrc` if you use zsh): ``` # Add Android SKD to PATH ANDROID_SDK_ROOT=$HOME/Android/Sdk export CAPACITOR_ANDROID_STUDIO_PATH=$HOME/Applications/android-studio PATH="$HOME/Applications/android-studio/bin:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/emulator:$PATH" export PATH ``` If `ionic cap open android` could not work, use `studio.sh android &` instead -
samuelyee renamed this gist
Sep 25, 2022 . 1 changed file with 10 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Ionic Android Development on WSL2 ## Installing the required software Execute the following commands to install Node, npm, git, Java, Ionic, Cordova and Angular CLI: @@ -8,32 +8,27 @@ cd ~ sudo apt update sudo apt upgrade curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash nvm install --lts nvm use --lts sudo apt install git git config --global user.email "you@yourmail.com" git config --global user.name "Your Name" git config --global core.autocrlf input sudo add-apt-repository ppa:maarten-fonville/android-studio sudo apt-get update sudo apt install openjdk-11-jdk ``` ## Downloading the Android SDK Tools To download the Android SDK tools in your home folder execute the following commands: ``` mkdir -p $HOME/Downloads && cd "$_" wget https://r2---sn-npoe7nss.gvt1.com/edgedl/android/studio/ide-zips/2021.3.1.16/android-studio-2021.3.1.16-linux.tar.gz mkdir -p $HOME/Applications && cd "$_" tar xfv $(ls -1t $HOME/Downloads/android-studio-* | head -n1) ``` Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads -
fedme revised this gist
Sep 12, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,6 +23,8 @@ sudo apt-get install oracle-java8-installer sudo apt install oracle-java8-set-default ``` NOTE: Node can be installed via NVM (node version manager) on ZSH as described here: http://www.boekhoff.info/how-to-install-nodejs-and-npm-using-nvm-and-zsh-nvm/ ## Downloading the Android SDK Tools To download the Android SDK tools in your home folder execute the following commands: -
fedme revised this gist
Sep 6, 2018 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -58,6 +58,13 @@ sdkmanager "build-tools;26.0.2" "platform-tools" "platforms;android-26" "tools" sdkmanager --licenses ``` ## Install Gradle Install gradle with the following command: ```sh sudo apt install gradle ``` ## ADB Alias We can default to Windows's adb.exe (which can read USB) instead of the Linux one. -
fedme revised this gist
Aug 27, 2018 . 1 changed file with 25 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -56,4 +56,29 @@ sdkmanager --update sdkmanager --list sdkmanager "build-tools;26.0.2" "platform-tools" "platforms;android-26" "tools" sdkmanager --licenses ``` ## ADB Alias We can default to Windows's adb.exe (which can read USB) instead of the Linux one. Create a `~/.aliases` file with the following content: ``` alias adb='adb.exe' ``` ### ZSH If you use ZSH, add the following to your `.zshrc` ``` source $HOME/.aliases ``` ### Bash If you use bash, add the following to your `.bashrc` ``` if [ -f ~/.aliases ]; then . ~/.aliases fi ``` -
fedme revised this gist
Aug 27, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,7 +36,7 @@ unzip sdk-tools-linux-4333796.zip Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads ## Adding the Android SDK to your PATH Add the following to your `.profile` (or `.zshenv` if you use zsh): ``` # Add Android SKD to PATH -
fedme renamed this gist
Aug 27, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
fedme renamed this gist
Aug 27, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # Ionic Android Development on WSL ## Installing the required software Execute the following commands to install Node, npm, git, Java, Ionic, Cordova and Angular CLI: -
fedme revised this gist
Aug 27, 2018 . 1 changed file with 5 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,27 +22,24 @@ sudo apt install oracle-java8-set-default ``` ## Downloading the Android SDK Tools To download the Android SDK tools in your home folder execute the following commands: ``` cd ~ sudo mkdir android-sdk cd android-sdk wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip unzip sdk-tools-linux-4333796.zip ``` Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads ## Adding the Android SDK to your PATH Add the following to your `.profile` (or `.zprofile` if you use zsh): ``` # Add Android SKD to PATH export ANDROID_HOME=$HOME/android-sdk PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH" export PATH ``` -
fedme revised this gist
Aug 27, 2018 . 1 changed file with 10 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ ## Installing the required software Execute the following commands to install Node, npm, git, Java, Ionic, Cordova and Angular CLI: ``` cd ~ @@ -19,14 +19,20 @@ sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer sudo apt install oracle-java8-set-default ``` ## Downloading the Android SDK Tools To download the Android SDK tools in your home folderm execute the following commands: ``` cd ~ wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip unzip sdk-tools-linux-4333796.zip mv tools android-sdk-tools ``` Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads ## Adding the Android SDK to your PATH Add the following to your `.profile` (or `.zprofile` if you use zsh): ``` @@ -40,7 +46,7 @@ PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH" export PATH ``` ## Installing the required Android SDK components Execute the following commands to install some basic Android SDK components. Note that you can install any component listed with `sdkmanager --list` by running `sdkmanager "packagename"`. -
fedme revised this gist
Aug 27, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,7 +31,7 @@ Add the following to your `.profile` (or `.zprofile` if you use zsh): ``` # Add Android SDK Manager to the PATH PATH="$HOME/android-sdk-tools:/$HOME/android-sdk-tools/bin:$PATH" # Add Android SKD to PATH export ANDROID_HOME=/usr/lib/android-sdk -
fedme revised this gist
Aug 27, 2018 . 1 changed file with 15 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ## Install Instructions Execute the following commands to install Node, npm, git and Java: ``` @@ -26,7 +26,7 @@ mv tools android-sdk-tools ``` Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads ## Adding Android SDK to Path Add the following to your `.profile` (or `.zprofile` if you use zsh): ``` @@ -38,4 +38,17 @@ export ANDROID_HOME=/usr/lib/android-sdk PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH" export PATH ``` ## Install the required Android SDK components Execute the following commands to install some basic Android SDK components. Note that you can install any component listed with `sdkmanager --list` by running `sdkmanager "packagename"`. Always run `sdkmanager --licenses` to accept all the licenses after installing something. ``` sdkmanager --update sdkmanager --list sdkmanager "build-tools;26.0.2" "platform-tools" "platforms;android-26" "tools" sdkmanager --licenses ``` -
fedme revised this gist
Aug 27, 2018 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,5 @@ # Install Instructions Execute the following commands to install Node, npm, git and Java: ``` cd ~ @@ -21,14 +20,14 @@ sudo apt-get update sudo apt-get install oracle-java8-installer sudo apt install oracle-java8-set-default wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip unzip sdk-tools-linux-4333796.zip mv tools android-sdk-tools ``` Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads # Adding Android SDK to Path Add the following to your `.profile` (or `.zprofile` if you use zsh): ``` # Add Android SDK Manager to the PATH @@ -37,4 +36,6 @@ PATH="/home/raimaj/android-sdk-tools:/home/raimaj/android-sdk-tools/bin:$PATH" # Add Android SKD to PATH export ANDROID_HOME=/usr/lib/android-sdk PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH" export PATH ``` -
fedme renamed this gist
Aug 27, 2018 . 1 changed file with 17 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ # Install Instructions This is not a bash file! Just a lot command you need to run! ``` cd ~ sudo apt update sudo apt upgrade @@ -23,3 +25,16 @@ sudo apt install oracle-java8-set-default wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip unzip sdk-tools-linux-4333796.zip mv tools android-sdk-tools ``` # Adding Android SDK to Path Add the following to your `.profile`: ``` # Add Android SDK Manager to the PATH PATH="/home/raimaj/android-sdk-tools:/home/raimaj/android-sdk-tools/bin:$PATH" # Add Android SKD to PATH export ANDROID_HOME=/usr/lib/android-sdk PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH" ``` -
fedme renamed this gist
Aug 27, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
fedme created this gist
Aug 27, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ # This is not a bash file! # Just a lot command you need to run! cd ~ sudo apt update sudo apt upgrade curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs sudo npm i -g ionic cordova @nestjs/cli @angular/cli sudo apt install git git config --global user.email "you@yourmail.com" git config --global user.name "Your Name" git config --global core.autocrlf input sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer sudo apt install oracle-java8-set-default # You can get an updated link from https://developer.android.com/studio/#downloads wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip unzip sdk-tools-linux-4333796.zip mv tools android-sdk-tools