Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,14 @@ public object AndroidInfoHelpers {
context.resources.getInteger(R.integer.react_native_dev_server_port)

private fun getServerIpAddress(context: Context?, port: Int): String {
val metroHost = getMetroHostPropValue()
// A "host:port" value names the port too, like RCT_jsLocation on iOS.
if (metroHost.contains(':')) {
return metroHost
}
val ipAddress: String =
when {
getMetroHostPropValue().isNotEmpty() -> getMetroHostPropValue()
metroHost.isNotEmpty() -> metroHost
isRunningOnGenymotion() -> GENYMOTION_LOCALHOST
isRunningOnStockEmulator() -> EMULATOR_LOCALHOST
else -> DEVICE_LOCALHOST
Expand Down
Loading