Skip to content

Commit 74732f9

Browse files
authored
fix(devtool): node 18 compatibility (#30)
1 parent 1939d8a commit 74732f9

File tree

1 file changed

+10
-1
lines changed
  • packages/skills/lynx-devtool/src

1 file changed

+10
-1
lines changed

packages/skills/lynx-devtool/src/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@ import {
1010
} from '@lynx-js/devtool-connector/transport';
1111
import { createProgram } from './devtool.ts';
1212

13+
function getAndroidTransportSpec(): { host: string; port: number } {
14+
const port = Number.parseInt(process.env['ADB_SERVER_PORT'] ?? '5037', 10);
15+
16+
return {
17+
host: process.env['ADB_SERVER_HOST'] ?? '127.0.0.1',
18+
port: Number.isInteger(port) && port > 0 ? port : 5037,
19+
};
20+
}
21+
1322
const transports: Transport[] = [
14-
new AndroidTransport(),
23+
new AndroidTransport(getAndroidTransportSpec()),
1524
new DesktopTransport(),
1625
new iOSTransport(),
1726
];

0 commit comments

Comments
 (0)