Debugging a React Native app typically begins with Chrome DevTools. Opening the developer menu by shaking the device or pressing Cmd+D/Ctrl+M in the emulator and selecting 'Debug JS Remotely' opens Chrome at localhost:8081/debugger-ui, where you can set breakpoints, view console logs, and step through code. React DevTools provides a separate window for inspecting the component tree. LogBox is the in-app warning and error console during development, and noisy third-party warnings can be silenced with LogBox.ignoreLogs. To detect whether code is running in development versus production, check the __DEV__ global flag or Constants.expoConfig.developmentClient from expo-constants.
Testing React Native components relies on Jest and @testing-library/react-native. Components are rendered with render(), queried with getByText, getByTestId, or getByRole, and interacted with using fireEvent.press() and similar helpers. Native modules are mocked via jest.mock('module-name') in setup files, and snapshot tests verify rendered output. For end-to-end testing, Detox provides automated interaction with native apps. Memory leaks can be detected by watching the Performance Monitor during development, profiling with Android Studio's Memory Profiler or Xcode Instruments, and looking for uncleared subscriptions and timers. Global error handling combines ErrorUtils.setGlobalHandler for uncaught JavaScript errors, native crash reporters like Sentry or Crashlytics for native crashes, and React error boundaries using componentDidCatch for render-time errors.
Accessibility is essential for inclusive mobile apps. The accessibilityLabel prop provides a textual label that VoiceOver on iOS and TalkBack on Android read aloud when the element receives accessibility focus, while accessibilityHint explains what activating the element does and accessibilityRole communicates the element type. accessibilityElementsHidden and importantForAccessibility let you hide decorative elements from screen readers. The useColorScheme hook, available since React Native 0.65, returns 'light', 'dark', or null based on system preference, enabling automatic dark mode support when combined with theme objects. To respect user preferences, multiply font sizes by PixelRatio.getFontScale() so text scales with the user's accessibility settings. SafeAreaView and react-native-safe-area-context handle device-specific insets like notches and home indicators across platforms.