@react-native-harness/platforms
v1.0.0-alpha.19
Published
Core platform abstractions for React Native Harness
Readme

Core platform abstractions for React Native Harness - provides the base types and factory functions for creating platform implementations.
Installation
npm install @react-native-harness/platforms
# or
pnpm add @react-native-harness/platforms
# or
yarn add @react-native-harness/platformsUsage
This package provides the core abstractions for creating platform implementations. It's typically used by platform-specific packages rather than directly by end users.
import { createHarnessPlatform } from '@react-native-harness/platforms';
const platform = createHarnessPlatform({
name: 'my-platform',
getInstance: async () => ({
startApp: async () => {
/* implementation */
},
restartApp: async () => {
/* implementation */
},
stopApp: async () => {
/* implementation */
},
dispose: async () => {
/* implementation */
},
}),
});API
createHarnessPlatform(params)
Creates a new harness platform instance.
Parameters:
params.name- Unique name for the platformparams.getInstance- Function that returns a platform instance
Returns: HarnessPlatform
HarnessPlatform
Core platform interface.
Properties:
name- Platform namegetInstance()- Returns a platform instance
HarnessPlatformInstance
Platform instance interface with lifecycle methods.
Methods:
startApp()- Starts the applicationrestartApp()- Restarts the applicationstopApp()- Stops the applicationdispose()- Cleans up resources
Error Classes
AppNotInstalledError
Thrown when an app is not installed on a device.
Properties:
bundleId- The bundle ID that wasn't founddeviceName- The device name
DeviceNotFoundError
Thrown when a device is not found.
Properties:
deviceName- The device name that wasn't found
Requirements
- TypeScript support
- Node.js runtime
License
MIT
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! 🔥
