# React Native

## 1. React Native - iOS

* If you're using React Native for the iOS app, you can simply follow the iOS Guidelines. There is no difference from the iOS native app.
* Works with Expo or Metro bundler

{% content-ref url="/pages/-LlQ19ku2tYS3NsRLWXo" %}
[iOS Device](/debug-devices/ios-device.md)
{% endcontent-ref %}

{% content-ref url="/pages/-LlQ1Bhv9TgSkeXN8TYp" %}
[iOS Simulator](/debug-devices/ios-simulator.md)
{% endcontent-ref %}

## 2. React Native - Android

Basically, To capture HTTP/HTTPS traffic from React Native for Android apps, it's similar to the native Android app. Please follow the Android Setup Guide:

* [Android Physical Device](/debug-devices/android-device.md)
* [Android Emulator](#android-emulator)

{% hint style="warning" %}
Make sure you've followed all steps in the Guideline, especially the **5th step**, where you add the **res/xml/network\_security\_config.xml** and **AndroidManifest.xml**

Otherwise, Proxyman could not decrypt the SSL connection.
{% endhint %}

## 3. Troubleshooting - Android

### 3.1 Metro bundle errors

After setting the HTTP Proxy from your Android to Proxyman, you might encounter the following error because Metro Bundle could not connect to its local server.

<figure><img src="/files/UQMpgAYqQlWVWmWEYxXs" alt=""><figcaption><p>Metro bundle errors</p></figcaption></figure>

To fix it:

#### Android Emulator

1. Open Proxyman -> Certificate menu -> Install for Android -> Emulator -> Click on the "Revert the Proxy"
2. Open Android Emulator -> Setting App -> Network -> Wifi -> Find a way to change the proxy
3. Change the HTTP Proxy manually by using the **Proxyman IP & Port**. If you don't know what the IP & Port is, open the Certificate menu -> Install for Android -> Physical Device -> In the 2nd section. Find the Server IP & Port.
4. Before saving, enter the `localhost` in the bypass Proxy List ✅

![CleanShot 2023-04-05 at 22 28 12 2@2x](https://user-images.githubusercontent.com/5878421/230129476-4bd5d1a0-c3c5-4c73-bb79-81f14a071e63.jpg)

5. Done
6. `The Bridge Was shutdown` warning and the metro bundle errors are gone ✅

#### Android Physical Device

1. Open Android Physical Device -> Setting App -> Network -> Wifi -> Find a way to change the proxy
2. Change the HTTP Proxy manually by using the Proxyman IP & Port. If you don't know what the IP & Port is, open the Certificate menu -> Install for Android -> Physical Device -> In the 2nd section. Find the Server IP & Port.
3. Before saving, enter them `your IP` in the bypass Proxy List ✅
4. Done

Read more at: <https://github.com/ProxymanApp/Proxyman/issues/1407#issuecomment-1497235102>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.proxyman.com/debug-devices/react-native.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
