1. Give the screen test IDs
testID is the prop to use. React Native passes it to the platform as the accessibilityIdentifier on iOS and the resource-id on Android, and getByTestId finds both.
Labels and roles help too: with role="button" and a label, the test can find the button the way a screen reader does.
<TextInput testID="email" aria-label="Email" placeholder="Email" />
<TextInput testID="password" aria-label="Password" placeholder="Password" secureTextEntry />
<Pressable testID="sign-in" role="button" aria-label="Sign in" onPress={signIn}>
<Text>Sign in</Text>
</Pressable>
{signedIn && <Text testID="welcome">Welcome back</Text>}App.tsx, the sign-in screen