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:
committed by
Facebook GitHub Bot
parent
e7a180b90c
commit
94cb8935b2
@@ -43,7 +43,7 @@ test('have defaults', () => {
|
|||||||
process.env.ADB_SERVER_SOCKET = undefined;
|
process.env.ADB_SERVER_SOCKET = undefined;
|
||||||
const {port, host} = adbConfig();
|
const {port, host} = adbConfig();
|
||||||
expect(port).toBe(5037);
|
expect(port).toBe(5037);
|
||||||
expect(host).toBe('localhost');
|
expect(host).toBe('127.0.0.1');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('prefer settings parameters over ANDROID_ADB_SERVER_PORT', () => {
|
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;
|
process.env.ADB_SERVER_SOCKET = undefined;
|
||||||
const {port, host} = adbConfig({port: 1338});
|
const {port, host} = adbConfig({port: 1338});
|
||||||
expect(port).toBe(1338);
|
expect(port).toBe(1338);
|
||||||
expect(host).toBe('localhost');
|
expect(host).toBe('127.0.0.1');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export default (settings?: {host?: string; port?: number}) => {
|
|||||||
5037,
|
5037,
|
||||||
) as number;
|
) as number;
|
||||||
|
|
||||||
let host = 'localhost';
|
let host = '127.0.0.1';
|
||||||
|
|
||||||
const socket = (process.env.ADB_SERVER_SOCKET || '').trim();
|
const socket = (process.env.ADB_SERVER_SOCKET || '').trim();
|
||||||
if (socket && socket.length > 0) {
|
if (socket && socket.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user