@react-native-harness/platform-android
v1.3.0
Published
Android platform for React Native Harness
Readme

Android platform for React Native Harness - enables testing on Android emulators and physical devices.
Installation
npm install @react-native-harness/platform-android
# or
pnpm add @react-native-harness/platform-android
# or
yarn add @react-native-harness/platform-androidUsage
Import the Android platform functions in your rn-harness.config.mjs:
import {
androidPlatform,
androidEmulator,
physicalAndroidDevice,
} from '@react-native-harness/platform-android';
const config = {
runners: [
androidPlatform({
name: 'android',
device: androidEmulator('Pixel_8_API_35', {
apiLevel: 35,
profile: 'pixel_8',
diskSize: '1G',
heapSize: '1G',
}),
bundleId: 'com.your.app',
}),
androidPlatform({
name: 'physical-device',
device: physicalAndroidDevice('Motorola', 'Moto G72'),
bundleId: 'com.your.app',
}),
],
// ... other config
};
export default config;API
androidPlatform(config)
Creates an Android platform runner configuration.
Parameters:
config.name- Unique name for the runnerconfig.device- Android device configuration (emulator or physical)config.bundleId- Android application bundle ID
androidEmulator(deviceName)
Creates an Android emulator device configuration.
Parameters:
deviceName- Name of the Android emulator (e.g., 'Pixel_8_API_35')
physicalAndroidDevice(manufacturer, model)
Creates a physical Android device configuration.
Parameters:
manufacturer- Device manufacturer (e.g., 'Motorola')model- Device model (e.g., 'Moto G72')
Requirements
- On macOS and Linux, Harness can resolve the SDK root from
ANDROID_HOME, thenANDROID_SDK_ROOT, then the default SDK path (~/Library/Android/sdkon macOS or~/Android/Sdkon Linux) - For emulator runners with an
avdconfig, Harness reads the runner config and automatically verifies or installs missing SDK packages, includingplatform-tools,emulator,platforms;android-<apiLevel>, and the matching system image for the host architecture - If the SDK root does not exist yet on macOS or Linux, Harness bootstraps Android command-line tools and accepts licenses for non-interactive installs
- Android emulator or physical device connected
- React Native project configured for Android
Made with ❤️ at Callstack
react-native-harness is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. Callstack is a group of React and React Native geeks, contact us at [email protected] if you need any help with these or just want to say hi!
Like the project? ⚛️ Join the team who does amazing stuff for clients and drives React Native Open Source! 🔥
