AsyncStorage and Network Debugging Tool for React Native
- Introduction
- Installation
- Features
- Usage Guide
- Network Monitor
- Configuration
- Troubleshooting
- Contributing
- License
React Native Debug Monitor is a development tool designed to facilitate real-time debugging and management of AsyncStorage and Network requests in React Native applications. Through its integration with Visual Studio Code, developers can visualize, edit, and manage AsyncStorage data and monitor network activity directly from their development environment.
Install the npm package in your React Native project:
npm install --save-dev react-native-debug-monitor
Install the "React Native Debug Monitor" extension from the Visual Studio Code marketplace.
- Real-time AsyncStorage visualization
- Network request monitoring (XHR, Fetch, and Axios)
- Edit and delete storage values directly from VSCode
- Network request inspection with details (headers, body, response)
- Automatic data updates
- Preview/Edit toggle for better readability
- Support for both emulators and physical devices
- Auto-reconnect capability
- Copy values to clipboard
- Manual refresh option
Add the following code to your React Native application's entry point:
import StorageDebugger from 'react-native-debug-monitor';
if (__DEV__) {
// For emulators
StorageDebugger.start();
}
To enable network monitoring with Axios:
import StorageDebugger from 'react-native-debug-monitor';
import axios from './axiosCustom'; // Your axios instance
if (__DEV__) {
StorageDebugger.start();
// Configure axios monitoring (optional)
if (StorageDebugger.networkMonitor) {
StorageDebugger.networkMonitor.addAxiosInstance(axios);
}
}
When using a physical device, specify your computer's IP address:
if (__DEV__) {
StorageDebugger.start({
serverIP: '192.168.1.100', // Replace with your computer's local IP address
});
}
For advanced configurations:
StorageDebugger.start({
serverIP: '192.168.1.100', // Optional: Your computer's IP address
port: 8083, // Optional: Custom port
});
- Open Command Palette (Cmd/Ctrl + Shift + P)
- Type "RN: View Storage" for storage management
- Type "RN: View Network" for network monitoring
- Press Enter
- Monitor XHR, Fetch, and Axios requests
- Real-time request tracking
- Request/Response inspection
- Headers and body examination
- Status code tracking
- Request timing information
- Clear request history
- Support for custom Axios instances
The network monitor provides detailed information for each request:
- Method (GET, POST, PUT, etc.)
- URL
- Status code
- Response time
- Request headers
- Request body
- Response headers
- Response body
- Open the Network Monitor from VSCode
- View real-time requests
- Click on any request to view details
- Use the Clear History button to reset
- Use the Refresh button to update the view
interface StorageDebuggerOptions {
serverIP?: string; // Your computer's IP address for physical devices
port?: number; // Custom port number
monitorNetwork?: boolean; // Enable/disable network monitoring (default: true)
}
- Default port: 12380
- Default host:
- Emulators: Automatically configured
- iOS Simulator: 'localhost'
- Android Emulator: '10.0.2.2'
- Network monitoring: Enabled by default
- Ensure device and computer are on the same network
- Verify the correct IP address is being used
- Check if port 12380 is not blocked by firewall
- Confirm the development server is running
- Verify network monitoring is enabled
- Check axios instance configuration
- Ensure requests are made after initialization
- Verify WebSocket connection status
-
Connection fails
- Check network configuration
- Verify IP address
- Ensure development mode is enabled
-
No data displays
- Verify AsyncStorage initialization
- Check console for error messages
- Try manual refresh
-
Network requests not showing
- Verify network monitor initialization
- Check axios instance configuration
- Ensure requests are made after setup
Contributions are welcome! Visit our GitHub repository at: https://github.com/rogercg/rn-storage-manager
Steps to contribute:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License.