Files
flipper/docs/custom-ports.mdx
Mathis Gardon f25d189aa5 Support custom metro ports (#2050)
Summary:
Based on issue https://github.com/facebook/flipper/issues/1509 I needed a custom port for the metro server to pass to flipper.

## Changelog

introduce `METRO_SERVER_PORT` env variable to be able to customize default 8081 port on startup.

Pull Request resolved: https://github.com/facebook/flipper/pull/2050

Test Plan:
Tested with a locally built linux desktop app, this seems to work OK pour hermes debugging & RN logging.

React DevTools don't seem to find the running app, maybe there's a mapping to handle there too ?

Reviewed By: jknoxville

Differential Revision: D27339006

Pulled By: passy

fbshipit-source-id: b1700c4fe73f14bf4617e23583b2954012e0a5aa
2021-03-31 03:30:14 -07:00

42 lines
1.1 KiB
Plaintext

---
id: custom-ports
title: Running Flipper with different ports
sidebar_label: Using different ports
---
## FLIPPER ports
By default Flipper runs its servers on ports 8088 and 8089, and the mobile SDKs look for servers on those ports.
Each of these can be overridden by setting an environment variable, with the format `${INSECURE_PORT},${SECURE_PORT}`.
To run the desktop app using custom ports:
```
FLIPPER_PORTS=1111,2222 ./flipper
```
To configure the Android SDK for custom ports, set the `flipper.ports` prop to your chosen ports `1111,2222` like so, and then launch the Android app:
```
adb shell su 0 setprop flipper.ports 1111,2222
```
To configure the iOS SDK for custom ports, set the FLIPPER_PORTS environment variable in your app launch script.
## METRO SERVER PORTS
You can also setup Flipper to use a different Metro Server port (default=8081) using this environement variable:
```
METRO_SERVER_PORT=3333 ./flipper
```
## ADB REVERSE PROXY PORTS
And setup a different ADB port used for reverse proxying when plugged through USB (default=5037) using:
```
ANDROID_ADB_SERVER_PORT=4444 ./flipper
```