Mobilewright

Mobilewright is a framework for mobile automation and testing. Control iOS and Android devices, simulators, and emulators from tests, scripts, coding agents, and MCP clients, with a developer experience inspired by Playwright.
Get Started · API Examples · Documentation · API Reference · Roadmap · Mobile Next Cloud
Get Started
Choose the path that fits your workflow:
Prerequisites
All four workflows require Node.js 22.12 or newer. For local automation, have a booted simulator or emulator, or a connected device ready before you start:
- iOS: macOS with Xcode and the Command Line Tools. Boot an iOS simulator, or connect and trust a real iPhone.
- Android: a JDK and the Android SDK, with
ANDROID_HOME set and adb on your PATH. Start an emulator, or connect a device with USB debugging enabled and authorized.
- Your app: install a build on the device and note its bundle ID (iOS) or package name (Android). The examples use
com.example.myapp; replace it with your app's ID and adapt the labels and expected text to your app.
Check your local environment and available devices:
npx mobilewright doctor
npx mobilewright devices
Mobilewright includes mobilecli for local device control. The doctor command reports missing dependencies and how to fix them.
For a real iPhone, install the device agent using a development provisioning profile that includes your device and a matching signing certificate with its private key in your Mac's keychain:
npx mobilewright install --device <device-id> --provisioning-profile /path/to/profile.mobileprovision
Replace <device-id> with the ID from devices and the profile path with your own. See mobilecli setup for signing requirements.
See Installation, Windows setup, Android in Docker, and Troubleshooting for platform-specific instructions. Tests and library scripts can also use cloud device providers; MCP supports Mobile Next Cloud without a local device toolchain.
Mobilewright Test
Write repeatable end-to-end tests with @mobilewright/test, which extends Playwright Test with mobile device and screen fixtures, auto-waiting locators, retrying assertions, and test reports.
Install
Scaffold a project:
npm init mobilewright@latest
Or add Mobilewright to an existing Node.js project:
npm install --save-dev mobilewright @mobilewright/test
npx mobilewright init
Configure your app
Edit the generated mobilewright.config.ts (or mobilewright.config.js if you chose JavaScript):
import { defineConfig } from 'mobilewright';
export default defineConfig({
platform: 'ios',
bundleId: 'com.example.myapp',
deviceName: /iPhone/,
timeout: 30_000,
});
For Android, set platform: 'android' and change or remove deviceName. You can also select a specific device with deviceId. The app must already be installed, or you can add installApps with the path to a compatible build, such as an Android .apk or a real-device iOS .ipa.
Write a test
Replace the generated example test with this sign-in flow. Use your app's field labels, a test account, and the text shown after a successful sign-in:
import { test, expect } from '@mobilewright/test';