Fix adb connection

Summary: On my mac localhost resolves to an IP6 address by the new adb lib. This should fix it.

Reviewed By: LukeDefeo

Differential Revision: D46314612

fbshipit-source-id: 3771efd2c6b79fe9ae9851ce4aac35bcede28847
This commit is contained in:
Andrey Goncharov
2023-05-31 09:25:55 -07:00
committed by Facebook GitHub Bot
parent e7a180b90c
commit 94cb8935b2
2 changed files with 3 additions and 3 deletions

View File

@@ -43,7 +43,7 @@ test('have defaults', () => {
process.env.ADB_SERVER_SOCKET = undefined;
const {port, host} = adbConfig();
expect(port).toBe(5037);
expect(host).toBe('localhost');
expect(host).toBe('127.0.0.1');
});
test('prefer settings parameters over ANDROID_ADB_SERVER_PORT', () => {
@@ -83,5 +83,5 @@ test('prefer port settings parameters over ANDROID_ADB_SERVER_PORT', () => {
process.env.ADB_SERVER_SOCKET = undefined;
const {port, host} = adbConfig({port: 1338});
expect(port).toBe(1338);
expect(host).toBe('localhost');
expect(host).toBe('127.0.0.1');
});

View File

@@ -15,7 +15,7 @@ export default (settings?: {host?: string; port?: number}) => {
5037,
) as number;
let host = 'localhost';
let host = '127.0.0.1';
const socket = (process.env.ADB_SERVER_SOCKET || '').trim();
if (socket && socket.length > 0) {