Accessing the Inspector
From the Dev Menu
Open dev menu
- iOS: Shake device or press
Cmd+Din simulator - Android: Shake device or press
Cmd+M/Ctrl+Min emulator
Programmatically
Using the Inspector
Inspecting Elements
View details
An overlay appears showing:
- Component name
- Element dimensions
- Position (x, y)
- Style properties
- Component hierarchy
Inspector Overlay
The inspector shows:Debugging Layouts
Layout Boundaries
The inspector highlights element boundaries with colored borders:app/components/Card.tsx
Flexbox Debugging
Inspect flex layout properties:app/components/Row.tsx
Measuring Dimensions
Style Inspection
Computed Styles
The inspector shows final computed values:Style Priority
See which styles are applied when multiple sources exist:Platform-Specific Styles
Component Hierarchy
Navigation
The breadcrumb trail shows the component tree:Finding Components
Advanced Inspection
Custom Inspector Integration
Extend inspector functionality:app/components/Inspectable.tsx
Performance Monitoring
Combine with performance monitor:Snapshot Testing
Capture inspector state for testing:E2E Testing Integration
The inspector’s element detection is similar to E2E test selectors.With Maestro
e2e/inspector-test.yaml
With Detox
e2e/inspector.test.ts
Troubleshooting
Inspector Not Showing
Can’t Tap Elements
Ensure elements are tappable:Missing Style Information
Some styles may not appear:Inspector Blocks Interaction
Disable inspector when done:Best Practices
1. Use testID for Identification
2. Meaningful Component Names
3. Avoid Deeply Nested Styles
4. Document Complex Layouts
Next Steps
DevTools
Explore Expo DevTools features
Debugging
Learn debugging techniques
E2E Testing
Set up end-to-end tests
Performance
Monitor performance