赵小福

赵小福

Build your own cloud phone with Redroid.

Lately, I've been using cloud phones a lot for gaming, and I happen to have an idle cloud server at hand, so I thought I'd set up my own cloud phone to play around with.

At the time of writing this article, Alibaba Cloud's Shadowless Cloud Computer offers a three-month free trial, with a configuration of 4 cores and 8GB Ubuntu 20 system (Amd64 architecture). It's currently idle, so I decided to tinker with it.

The solution I'm using to build the cloud phone is Redroid, deployed through Docker, and controlled remotely using Scrcpy.

Prerequisites#

  • Cloud server (recommended 2C4G or higher) Both Amd64 and Arm architectures are supported, with Arm being the best
  • How to use Scrcpy

My Environment#

  • Ubuntu 20.04
  • 4 cores, 8GB RAM, 4M bandwidth (Amd64 architecture)
Docker Hub:
https://hub.docker.com/r/redroid/redroid

Installation on Windows 10:
https://github.com/remote-android/redroid-doc/blob/master/deploy/wsl.md

Reference Blog:
https://blog.hanlin.press/2022/08/play-redroid-on-oracle-cloud/

1. Getting Started#

Install Docker#
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
Docker Image (Optional)#
# If installing Redroid with Docker is too slow, you can try modifying the image source (no guarantee of effectiveness)
sudo vim /etc/docker/daemon.json

{
 "registry-mirrors": ["https://docker.mirrors.tuna.tsinghua.edu.cn"]
}

sudo systemctl daemon-reload
sudo systemctl restart docker
Install Dependencies#
sudo apt install linux-modules-extra-`uname -r`
sudo modprobe binder_linux devices="binder,hwbinder,vndbinder"
sudo modprobe ashmem_linux
Install ADB#
sudo apt install adb
Install Scrcpy#
# Install via snap (slow installation)
snap install scrcpy

# Install via apt (older version)
apt install scrcpy

2. Run Docker and Install Redroid#

docker run -itd --rm --privileged \
    --pull always \
    -v ~/data:/data \
    -p 5555:5555 \
    redroid/redroid:11.0.0-latest

If you want to add some phone attributes to the cloud phone to make it more like a real phone and avoid some game restrictions, you can execute the following command to start the container.

docker run -itd --rm --memory-swappiness=0 \
    --privileged --pull always \
    -v /data:/data \
    -p 5555:5555 \
    redroid/redroid:11.0.0-latest \
    androidboot.hardware=mt6891 ro.secure=0 ro.boot.hwc=GLOBAL ro.ril.oem.imei=861503068361145 ro.ril.oem.imei1=861503068361145 ro.ril.oem.imei2=861503068361148 ro.ril.miui.imei0=861503068361148 ro.product.manufacturer=Xiaomi ro.build.product=chopin \
    redroid.width=720 redroid.height=1280 \
    redroid.gpu.mode=guest

This image is about 800MB in size. If there are network issues during image pulling (Docker Hub is slow in China), resulting in a failed pull, you can leave a message in my official account: Redroid Image, to get the Redroid Docker image.

After obtaining the image, you can import it locally without having to pull it remotely. If you don't know how to do it, you can send me a private message for a tutorial.

3. Connect Using ADB#

# If it's a remote machine, change localhost to the corresponding IP
adb connect localhost:5555

4. Connect with Scrcpy#

# Connect to a single device
scrcpy

# Connect to multiple devices by specifying the IP
scrcpy -s localhost:5555

Successful Connection, Redroid Started

5. Install Applications#

To install applications, simply drag and drop the APK file into the scrcpy window, and the terminal will output a log.

Swipe up from the bottom to open the app list#

Open App List

6. Redroid Installation Complete, Install Magisk to Manage Root Access on the Cloud Phone#

If you want to manage the root access of the cloud phone and grant root access to apps that require it, you can flash Magisk to achieve that.

You can easily install Magisk through the reference document mentioned above. If you're not sure how to do it, feel free to leave me a message, and I'll write an article about rooting later.

Reference Document:
https://gist.github.com/assiless/a23fb52e8c6156db0474ee8973c4be66
Magisk Installation Successful#

Magisk

Install Devcheck to View Phone Configuration#

Devcheck

Hardware Configuration

Final Words#

Alibaba Cloud's Shadowless Cloud Computer is an Amd64 architecture computer. The best solution for building a cloud phone is to use an Arm architecture server (eliminating the need for Amd64 to Arm instruction translation, with significantly better performance). However, Arm architecture servers from domestic cloud hosting providers are quite expensive and not available for free trial.

The only option available is the Oracle cloud server (https://cloud.oracle.com/), which provides a 4-core, 24GB Arm cloud server and offers a permanent free trial (this configuration is better than most real phones for building a cloud phone).

But due to too many people trying to get free resources, it's very difficult to get one. If you're interested, you can try your luck. When registering an account, don't choose popular regions like Korea or Japan, as you won't be able to get any resources there.

Reminder for Oracle Cloud Account Registration: You need to have a credit card that supports foreign currency payments for identity verification, which can be obtained from many banks. And you don't need to use a VPN proxy, but make sure to provide a real address (it's recommended to use your credit card billing address).

If registration fails, you can try connecting to a mobile network, switching browsers (or opening the browser's incognito mode), and trying multiple times.

Arm Server
Select Arm Instance

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.