العودة إلى المدونة
متصفح سحابي

Device Emulation: Mobile, Tablet, and Desktop Profiles in the Cloud

Run cloud browser sessions that accurately emulate mobile phones, tablets, and desktop devices with consistent touch, screen, and hardware signals.

Introduction

Device emulation goes far beyond setting a User-Agent string and viewport size. Websites check dozens of device-specific signals: touch capability, device memory, screen orientation, pointer type, hover support, and hardware concurrency. A session claiming to be an iPhone but lacking touch event support or reporting 32 GB of device memory is immediately suspicious.

BotCloud provides complete device emulation through profiles that coordinate all device-related signals.

What Real Device Emulation Requires

Touch Capabilities

Mobile devices expose touch-specific properties:

  • navigator.maxTouchPoints - Number of simultaneous touch points (typically 5 for phones)
  • 'ontouchstart' in window - Touch event support
  • CSS pointer: coarse media query match
  • CSS hover: none media query match (touchscreen devices cannot hover)

Screen Properties

Mobile screens have distinctive characteristics:

  • Device pixel ratio - 2x or 3x on modern phones, 1x on most desktops
  • Screen dimensions - 390x844 (iPhone 14), 360x800 (typical Android)
  • Orientation - screen.orientation.type reflects portrait/landscape

Hardware Signals

  • navigator.hardwareConcurrency - Mobile devices typically report 4-8 cores
  • navigator.deviceMemory - 2-4 GB for phones, 4-8 GB for tablets
  • navigator.platform - "Linux armv81" for Android, "iPhone" for iOS

GPU Identity

Mobile GPUs are different from desktop GPUs:

  • Android: Adreno, Mali, or PowerVR renderers
  • iOS: Apple GPU (not exposed in Chrome)
  • Desktop: NVIDIA, AMD, or Intel

Common Emulation Mistakes

  1. Setting User-Agent without touch support - Mobile UA + no ontouchstart = instant detection
  2. Desktop viewport on mobile UA - A phone with 1920x1080 viewport is suspicious
  3. Wrong device memory - An iPhone reporting 64 GB of memory
  4. Desktop GPU on mobile profile - NVIDIA GeForce on an "Android" device
  5. Missing orientation API - Desktop browsers do not support screen.orientation.lock()

BotCloud Device Profiles

BotCloud profiles cover the full spectrum of devices:

Desktop Profiles

// Windows desktop session
const browser = await puppeteer.connect({
  browserWSEndpoint: 'wss://bots.win/ws?apiKey=YOUR_API_KEY&device=desktop-windows',
});

Mobile Profiles

// Android mobile session
const browser = await puppeteer.connect({
  browserWSEndpoint: 'wss://bots.win/ws?apiKey=YOUR_API_KEY&device=mobile-android',
});

Tablet Profiles

// iPad-like tablet session
const browser = await puppeteer.connect({
  browserWSEndpoint: 'wss://bots.win/ws?apiKey=YOUR_API_KEY&device=tablet',
});

Each profile type coordinates all device signals to be internally consistent. A mobile profile sets the correct touch points, screen dimensions, device memory, GPU identity, User-Agent, and platform string.

Use Cases

Responsive Testing

Verify that your website works correctly on all device types:

const devices = ['desktop-windows', 'mobile-android', 'tablet'];

for (const device of devices) {
  const browser = await puppeteer.connect({
    browserWSEndpoint: `wss://bots.win/ws?apiKey=YOUR_API_KEY&device=${device}`,
  });
  const page = await browser.newPage();
  await page.goto('https://your-site.com');
  await page.screenshot({ path: `screenshot-${device}.png` });
  await browser.close();
}

Mobile-First Automation

Many platforms serve different content to mobile users. Cloud browser mobile profiles let you access mobile-specific content and APIs without a physical device.

Best Practices

  1. Match device type to use case - Do not use desktop profiles when the target expects mobile traffic
  2. Verify all signals - Check touch events, screen dimensions, and hardware properties together
  3. Use realistic device memory values - 2-4 GB for phones, 4-8 GB for tablets, 8-32 GB for desktops
  4. Consider the User-Agent version - Keep the browser version current for the claimed device
#device-emulation#mobile#tablet#profiles