waydroid
Waydroid uses a container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu.
Top Related Projects
Anbox is a container-based approach to boot a full Android system on a regular GNU/Linux system
Termux - a terminal emulator application for Android OS extendible by variety of packages.
Control and manage Android devices from your browser.
Display and control your Android device
Quick Overview
Waydroid is an open-source container-based approach to boot a full Android system on Linux. It uses Linux namespaces to run a complete Android system in a container and provide Android applications on any GNU/Linux-based platform.
Pros
- Enables running Android apps on Linux systems without emulation
- Provides near-native performance for Android applications
- Supports a wide range of Linux distributions
- Integrates well with the host system, including hardware acceleration and audio
Cons
- Requires a Linux system with specific kernel features enabled
- May have compatibility issues with some Android apps
- Setup process can be complex for less experienced users
- Limited support for older hardware or non-x86 architectures
Getting Started
To install Waydroid on a supported Linux distribution:
- Add the Waydroid repository:
sudo add-apt-repository ppa:waydroid/waydroid
- Update package lists and install Waydroid:
sudo apt update
sudo apt install waydroid
- Initialize Waydroid:
sudo waydroid init
- Start the Waydroid container:
sudo waydroid container start
- Launch the Waydroid session:
waydroid session start
For more detailed instructions and troubleshooting, refer to the official Waydroid documentation.
Competitor Comparisons
Anbox is a container-based approach to boot a full Android system on a regular GNU/Linux system
Pros of Anbox
- More mature project with longer development history
- Wider community support and documentation
- Better compatibility with older Android versions
Cons of Anbox
- Limited to LXC container technology
- Less frequent updates and slower development pace
- May have performance issues on some hardware configurations
Code Comparison
Anbox:
void AndroidContainerConfig::setup_rootfs_overlay() {
const auto overlay_path = utils::string_format("%s/rootfs-overlay", data_path_);
if (utils::is_directory(overlay_path))
mounts_.push_back({overlay_path, "/", "", MS_BIND | MS_REC, nullptr});
}
Waydroid:
def get_vendor_files(self):
vendor_files = []
for root, _, files in os.walk(self.vendor_path):
for file in files:
vendor_files.append(os.path.join(root, file))
return vendor_files
Anbox uses C++ for its core functionality, while Waydroid is primarily written in Python. Anbox's code focuses on container configuration and mounting, whereas Waydroid's example demonstrates file system operations for vendor files. This reflects their different approaches to Android containerization, with Anbox using LXC and Waydroid leveraging Linux namespaces and containerization features.
Termux - a terminal emulator application for Android OS extendible by variety of packages.
Pros of Termux
- Lightweight and runs directly on Android, requiring no additional VM or container
- Provides a full Linux terminal environment with package management
- Supports a wide range of programming languages and tools
Cons of Termux
- Limited to command-line interface, no GUI applications
- Restricted by Android's security model, limiting some system-level operations
- May have compatibility issues with certain hardware or Android versions
Code Comparison
Termux (shell script):
#!/data/data/com.termux/files/usr/bin/bash
pkg update
pkg install python
python -c "print('Hello from Termux!')"
Waydroid (Python script):
import subprocess
subprocess.run(["waydroid", "app", "install", "my_app.apk"])
subprocess.run(["waydroid", "app", "launch", "com.example.myapp"])
Key Differences
Termux is a terminal emulator and Linux environment for Android, focusing on providing a command-line interface for various development tasks. Waydroid, on the other hand, is a container-based approach to boot a full Android system in a Linux environment, allowing the use of Android apps and services.
While Termux excels in providing a lightweight Linux environment directly on Android devices, Waydroid offers a more complete Android experience, including GUI applications, at the cost of higher resource usage and complexity.
Control and manage Android devices from your browser.
Pros of STF
- Supports remote device control and management for multiple Android devices
- Provides a web-based interface for easy access and collaboration
- Offers screen mirroring and real-time interaction with connected devices
Cons of STF
- Requires more complex setup and infrastructure compared to Waydroid
- May have higher resource requirements for hosting and managing multiple devices
- Limited to Android devices, while Waydroid supports running Android in a container
Code Comparison
STF (JavaScript):
adb.shell(serial, ['input', 'keyevent', code])
.then(function() {
return adb.shell(serial, ['input', 'keyevent', '4'])
})
.then(resolver.resolve, resolver.reject)
Waydroid (Python):
def start(self):
self.container.start()
self.container.run(["waydroid", "session", "start"])
self.container.run(["waydroid", "show-full-ui"])
While STF focuses on device control and management through ADB commands, Waydroid's code demonstrates its container-based approach to running Android within Linux environments.
Display and control your Android device
Pros of scrcpy
- Lightweight and fast, with minimal latency
- Cross-platform support (Windows, macOS, Linux)
- No need for root access on the Android device
Cons of scrcpy
- Limited to mirroring and controlling existing Android devices
- Doesn't provide a full Android environment on the host system
- Requires a physical Android device or emulator to be connected
Code comparison
scrcpy (C):
static void screen_init_render(struct screen *screen)
{
SDL_RendererInfo renderer_info;
if (SDL_GetRendererInfo(screen->renderer, &renderer_info)) {
LOGW("Could not get renderer info");
return;
}
}
Waydroid (Python):
def get_container_state(self):
if not self.container:
return "STOPPED"
return self.container.state
Summary
scrcpy is a lightweight tool for mirroring and controlling Android devices, offering cross-platform support and low latency. However, it's limited to existing devices and doesn't provide a full Android environment.
Waydroid, on the other hand, creates a complete Android container on Linux systems, allowing for a more integrated experience but with higher system requirements and limited to Linux hosts.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Waydroid
Waydroid uses a container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu.
Overview
Waydroid uses Linux namespaces (user, pid, uts, net, mount, ipc) to run a full Android system in a container and provide Android applications on any GNU/Linux-based platform.
The Android system inside the container has direct access to any needed hardware.
The Android runtime environment ships with a minimal customized Android system image based on LineageOS. The image is currently based on Android 11.
Documentation
Our documentation site can be found at docs.waydro.id
Reporting bugs
If you have found an issue with Waydroid, please file a bug.
Get in Touch
If you want to get in contact with the developers please feel free to join the Waydroid groups in Matrix or Telegram.
Top Related Projects
Anbox is a container-based approach to boot a full Android system on a regular GNU/Linux system
Termux - a terminal emulator application for Android OS extendible by variety of packages.
Control and manage Android devices from your browser.
Display and control your Android device
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot