Skip to content

Instantly share code, notes, and snippets.

@sabrysuleiman
Created November 15, 2023 17:52
Show Gist options
  • Save sabrysuleiman/227141bc5fe3f19dab73d5374f4ec8e4 to your computer and use it in GitHub Desktop.
Save sabrysuleiman/227141bc5fe3f19dab73d5374f4ec8e4 to your computer and use it in GitHub Desktop.
Installing Apache Cordova on Ubuntu
# Install Node.js and npm
sudo apt update
sudo apt install nodejs
sudo apt install npm
# Install Cordova
sudo npm install -g cordova
# Create a Cordova Project
cordova create MyAndroidApp
# Add a Platform
cordova platform add android
# Build the App:
cordova build android
# Run the App
cordova run android
-----------------------------------------------
# if Java Development Kit (JDK) is not installed
# Install JDK:
sudo apt update
sudo apt install openjdk-8-jdk
# Set JAVA_HOME:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 # Adjust the path based on your installation
export PATH=$PATH:$JAVA_HOME/bin
# reload your shell configuration
source ~/.bashrc
# Verify Java Installation:
java -version
javac -version
-----------------------------------------------
# if Gradle is not installed
# Download and Extract Gradle:
https://gradle.org/releases/
# unzip file and move it to opt directory
sudo unzip ./gradle-8.4-all.zip
sudo mv ./gradle-8.4 /opt
# Set Gradle Home:
export GRADLE_HOME=/opt/gradle-<version> # Adjust the path based on your installation
export PATH=$PATH:$GRADLE_HOME/bin
# Reload your shell configuration
source ~/.bashrc
# Verify Gradle Installation:
gradle -v
-----------------------------------------------
# if Android SDK is not installed
# Installing from Ubuntu Repositories
sudo apt update
sudo apt install android-sdk
# Set the ANDROID_HOME environment variable
export ANDROID_HOME=/usr/lib/android-sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
# Reload your shell configuration:
Reload your shell configuration:
#Verify the installation:
echo $ANDROID_HOME
echo $PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment