Android Emulation
Emulate Android Chrome on desktop with full fingerprint protection, including consistent mobile identity, touch events, and device metrics.
Prerequisites
- BotBrowser binary installed. See INSTALLATION.md.
- An Android profile file (
.encor.json). Android profiles are available with PRO license. - PRO license for Android profile support.
Overview
BotBrowser can emulate Android Chrome on a desktop machine. When you load an Android profile, the browser reports Android-specific platform information, enables touch event support, adjusts the viewport to mobile dimensions, and configures all related API surfaces to match a real Android device.
This emulation happens at the browser engine level. JavaScript APIs, HTTP headers, and Client Hints all reflect the Android identity consistently, preventing cross-surface mismatches that would undermine identity consistency.
Quick Start
chromium-browser \
--bot-profile="/path/to/android-profile.enc" \
--proxy-server=socks5://user:pass@proxy.example.com:1080With Playwright:
import { chromium } from "playwright-core";
const browser = await chromium.launch({
executablePath: process.env.BOTBROWSER_EXEC_PATH,
headless: true,
args: [
"--bot-profile=/path/to/android-profile.enc",
"--proxy-server=socks5://user:pass@proxy.example.com:1080",
],
});
const page = await browser.newPage();
// Remove framework bindings
await page.addInitScript(() => {
delete window.__playwright__binding__;
delete window.__pwInitScripts;
});
await page.goto("https://example.com");
// Verify Android identity
const platform = await page.evaluate(() => navigator.platform);
const mobile = await page.evaluate(() => navigator.userAgentData.mobile);
console.log("Platform:", platform); // "Linux armv81" or similar
console.log("Mobile:", mobile); // true
await browser.close();How It Works
When running an Android profile, BotBrowser configures the following:
Platform Identity
BotBrowser configures all platform-related surfaces to report Android identity: platform strings, Client Hints headers, mobile/tablet flags, and the User-Agent string. All values are internally consistent across JavaScript APIs and HTTP headers.
Touch and Input
- Touch events enabled. Touch event support and touch point count reflect the profile value.
- Pointer type. The primary input reports as touch.
- Motion and orientation events. These events are available, consistent with a mobile device.
- Force touch. Configurable via
--bot-mobile-force-touchor the profile’smobileForceTouchsetting.
Screen and Viewport
- Mobile viewport. The viewport matches the Android device’s screen dimensions from the profile.
- Device pixel ratio. Reflects the profile’s DPR (commonly 2.0 or 3.0 for mobile devices).
- Screen orientation. Reports the profile-defined orientation. Use
--bot-config-orientation=landscape|portraitto control orientation at launch for both phone and tablet profiles.
DevTools Interface
BotBrowser normalizes the DevTools inspector page zoom and font scaling when debugging Android profiles, keeping the interface readable on desktop.
Phone vs. Tablet
The key difference between phone and tablet emulation is the mobile flag. Phones report true, tablets report false. This flag affects both JavaScript values and Client Hints headers.
Use --bot-config-mobile to override this value:
# Phone emulation
chromium-browser \
--bot-profile="/path/to/android-profile.enc" \
--bot-config-mobile=true
# Tablet emulation
chromium-browser \
--bot-profile="/path/to/android-profile.enc" \
--bot-config-mobile=falseCommon Scenarios
Android phone with specific device model
const browser = await chromium.launch({
executablePath: process.env.BOTBROWSER_EXEC_PATH,
headless: true,
args: [
"--bot-profile=/path/to/android-profile.enc",
"--proxy-server=socks5://user:pass@proxy.example.com:1080",
"--bot-config-model=SM-G991B",
"--bot-config-platform-version=14",
"--bot-config-mobile=true",
],
});Android with custom User-Agent (ENT Tier3)
chromium-browser \
--bot-profile="/path/to/android-profile.enc" \
--user-agent="Mozilla/5.0 (Linux; Android {platform-version}; {model}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{ua-full-version} Mobile Safari/537.36" \
--bot-config-platform=Android \
--bot-config-platform-version=13 \
--bot-config-model=SM-G991B \
--bot-config-mobile=true \
--bot-config-architecture=arm \
--bot-config-bitness=64Android tablet in landscape mode
const browser = await chromium.launch({
executablePath: process.env.BOTBROWSER_EXEC_PATH,
headless: true,
args: [
"--bot-profile=/path/to/android-tablet-profile.enc",
"--bot-config-orientation=landscape",
],
});Force touch events
const browser = await chromium.launch({
executablePath: process.env.BOTBROWSER_EXEC_PATH,
headless: true,
args: [
"--bot-profile=/path/to/android-profile.enc",
"--bot-mobile-force-touch",
],
});Troubleshooting / FAQ
| Problem | Solution |
|---|---|
navigator.userAgentData.mobile is false | Use --bot-config-mobile=true to force phone mode, or verify the profile is configured for phone (not tablet). |
| Touch events not firing | Ensure the profile is an Android profile and --bot-mobile-force-touch is set if needed. |
| Viewport too large for mobile | Do not set explicit viewport options in Playwright. Let the Android profile control dimensions. |
| Android profile not loading | Verify your license supports PRO features. Android profiles require PRO or higher. |
| Tablet orientation not changing | Use --bot-config-orientation=landscape or portrait. This works for both phone and tablet Android profiles. |
Next Steps
- Android WebView. Emulate in-app browser behavior.
- Custom User-Agent. Full userAgentData control for Android identities.
- Device Emulation. Control screen dimensions and device metrics.
- Cross-Platform Profiles. Run Android profiles on any desktop OS.
Related documentation: CLI Flags Reference | Advanced Features | Profiles README
Legal Disclaimer & Terms of Use • Responsible Use Guidelines . BotBrowser is for authorized fingerprint protection and privacy research only.