Android Emulator on the remote VPS with Ubuntu + XFCE GUI and desktop connection to your local
Start the standalone Android Emulator (AVD – android virtual device) from the command line on the remote server (VPS) with Ubuntu 22.04 LTS operation system and Xfce4 (graphical user interface). Set up a remote desktop connection to your local computer.
โก DigitalOcean cloud service: https://m.do.co/c/2307d54dc5e5
๐ฅ Digitalocean VPS is a very flexible thing, you can take it for a few hours and then destroy it. And again and again…
โก Android SDK: https://developer.android.com/studio
โก Open JDK: https://www.openlogic.com/openjdk-downloads
Step by step:
๐ท Setting up a virtual server with DigitalOcean:
๐ธ Take a virtual machine with a mix of memory and compute resources
๐ธ Resize a server. You can change the resources (CPU, RAM) that a server has
๐ธ Connect to your VPS with SSH
๐ท Install Ubuntu Xfce4 Desktop:
๐ธ apt update
๐ธ apt install xfce4 -y
๐ธ echo โxfce4-sessionโ | tee .xsession
๐ท Install Chrome Browser:
๐ธ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
๐ธ apt install ./google-chrome-stable_current_amd64.deb
๐ท Enable Remote Desktop Protocol:
๐ธ apt install xrdp -y
๐ธ ufw allow 3389/tcp
๐ท Just in case allow incoming ssh connection:
๐ธ ufw allow OpenSSH
๐ท Enable Firewall and check:
๐ธ ufw enable
๐ธ ufw status
๐ท Install Microsoft Remote Desktop on your computer:
๐ธ install the client
๐ธ add PC connection (server IP and root password)
๐ท Run Remote Desktop and download Android SDK Tools and Javaย Development Kit
๐ธ OpenJDK
๐ธ Android SDK Command line tools only
๐ท Extract Android SDK Tools and OpenJDK to a directory:
๐ธ mkdir devtools
๐ธ mkdir devtools/JDK
๐ธ mkdir devtools/android
๐ธ mkdir devtools/android/cmdline-tools
๐ธ ls ~/Downloads
๐ธ tar -zxvf ~/Downloads/openlogic-openjdk-11.0.18+10-linux-x64.tar.gz -C ~/devtools/JDK/
๐ธ cd ~/devtools/android/cmdline-tools
๐ธ apt install unzip
๐ธ unzip ~/Downloads/commandlinetools-linux-9477386_latest.zip
๐ธ mv cmdline-tools tools (just rename)
๐ท Set environment variables:
๐ธ vim ~/.bashrc
๐ธ add the code:
JAVA_HOME=”/root/devtools/JDK/openlogic-openjdk-11.0.18+10-linux-x64″
ANDROID_HOME=”/root/devtools/android”
export JAVA_HOME
export ANDROID_HOME
PATH=”$JAVA_HOME/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH”
๐ธ source ~/.bashrc
๐ท Check:
๐ธ java –version
๐ธ sdkmanager –version
๐ท Install Android Platform and Build Tools:
๐ธ sdkmanager –list
๐ธ sdkmanager “platform-tools” “platforms;android-33”
๐ธ sdkmanager “build-tools;33.0.2โ
๐ท Add android system image:
๐ธ sdkmanager –list
๐ธ sdkmanager “system-images;android-33;google_apis_playstore;x86_64″
๐ท Creating the AVD:
๐ธ avdmanager create avd –name โdevAvd” –package “system-images;android-33;google_apis_playstore;x86_64”
๐ท List avds:
๐ธ emulator -list-avds
๐ท Running the emulator:
๐ธ adb start-server
๐ธ emulator -avd devAvd
๐ท If BACK and HOME buttons donโt work use ads shell key events:
๐ธ adb shell input keyevent KEYCODE_BACK
๐ธ adb shell input keyevent KEYCODE_HOME
โSubscribe to this channel!