Android Emulator on the remote VPS with Ubuntu + XFCE GUI and desktop connection to your local



Android Emulator on the remote VPS with Ubuntu + XFCE GUI and desktop connection to your local

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!