Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 0 additions & 8 deletions lib/services/android-device-debug-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ export class AndroidDeviceDebugService extends DebugServiceBase implements IDevi
return this.removePortForwarding();
}

protected getChromeDebugUrl(debugOptions: IDebugOptions, port: number): string {
const debugOpts = _.cloneDeep(debugOptions);
debugOpts.useBundledDevTools = debugOpts.useBundledDevTools === undefined ? true : debugOpts.useBundledDevTools;

const chromeDebugUrl = super.getChromeDebugUrl(debugOpts, port);
return chromeDebugUrl;
}

private async debugOnEmulator(debugData: IDebugData, debugOptions: IDebugOptions): Promise<string> {
// Assure we've detected the emulator as device
// For example in case deployOnEmulator had stated new emulator instance
Expand Down
8 changes: 6 additions & 2 deletions lib/services/debug-service-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ export abstract class DebugServiceBase extends EventEmitter implements IDeviceDe

protected getChromeDebugUrl(debugOptions: IDebugOptions, port: number): string {
// corresponds to 55.0.2883 Chrome version
// SHA is taken from https://chromium.googlesource.com/chromium/src/+/55.0.2883.100
// This SHA is old and does not support debugging with HMR.
// In case we want to stick with concrete SHA, get it from one of the tags https://chromium.googlesource.com/chromium/src/
// IMPORTANT: When you get the SHA, ensure you are using the `parent` commit, not the actual one.
// Using the actual commit will result in 404 error in the remote serve.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe remote server 😸

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, devtools/remote/serve_file - that's why I used remote serve.

const commitSHA = debugOptions.devToolsCommit || "02e6bde1bbe34e43b309d4ef774b1168d25fd024";
debugOptions.useHttpUrl = debugOptions.useHttpUrl === undefined ? false : debugOptions.useHttpUrl;

let chromeDevToolsPrefix = `chrome-devtools://devtools/remote/serve_file/@${commitSHA}`;

if (debugOptions.useBundledDevTools) {
if (debugOptions.useBundledDevTools === undefined || debugOptions.useBundledDevTools) {
chromeDevToolsPrefix = "chrome-devtools://devtools/bundled";
}

Expand Down
8 changes: 0 additions & 8 deletions lib/services/ios-device-debug-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ export class IOSDeviceDebugService extends DebugServiceBase implements IDeviceDe
await this.stopAppDebuggerOnSimulator();
}

protected getChromeDebugUrl(debugOptions: IDebugOptions, port: number): string {
const debugOpts = _.cloneDeep(debugOptions);
debugOpts.useBundledDevTools = debugOpts.useBundledDevTools === undefined ? false : debugOpts.useBundledDevTools;

const chromeDebugUrl = super.getChromeDebugUrl(debugOpts, port);
return chromeDebugUrl;
}

private async startApp(debugData: IDebugData, debugOptions: IDebugOptions) {
if (this.device.isEmulator) {
await this.startAppOnSimulator(debugData, debugOptions);
Expand Down
14 changes: 8 additions & 6 deletions test/services/ios-device-debug-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe("iOSDeviceDebugService", () => {
{
scenarioName: "useBundledDevTools and useHttpUrl are not passed",
debugOptions: {},
expectedChromeUrl: `chrome-devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`,
expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`,
},

// When useBundledDevTools is true
Expand Down Expand Up @@ -137,7 +137,7 @@ describe("iOSDeviceDebugService", () => {
debugOptions: {
useHttpUrl: false
},
expectedChromeUrl: `chrome-devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`,
expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`,
},
{
scenarioName: "useBundledDevTools is not passed and useHttpUrl is true",
Expand All @@ -149,16 +149,18 @@ describe("iOSDeviceDebugService", () => {

// devToolsCommit tests
{
scenarioName: "devToolsCommit defaults to ${expectedDevToolsCommitSha} and is used in result when useBundledDevTools is not passed",
debugOptions: {},
scenarioName: `devToolsCommit defaults to ${expectedDevToolsCommitSha} and is used in result when useBundledDevTools is not passed`,
debugOptions: {
useBundledDevTools: false
},
expectedChromeUrl: `chrome-devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?experiments=true&ws=localhost:${expectedPort}`,
},
{
scenarioName: "devToolsCommit is set to passed value when useBundledDevTools is not passed",
scenarioName: "devToolsCommit is disregarded when useBundledDevTools is not passed",
debugOptions: {
devToolsCommit: customDevToolsCommit
},
expectedChromeUrl: `chrome-devtools://devtools/remote/serve_file/@${customDevToolsCommit}/inspector.html?experiments=true&ws=localhost:${expectedPort}`,
expectedChromeUrl: `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${expectedPort}`,
},
{
scenarioName: "devToolsCommit is set to passed value when useBundledDevTools is set to false",
Expand Down