Support for device picker during launch (#86)

This commit is contained in:
Dave Holoway
2020-04-23 16:44:19 +01:00
committed by GitHub
parent 44d887dd6c
commit 1535f133d9
5 changed files with 54 additions and 9 deletions

View File

@@ -4,6 +4,7 @@ const vscode = require('vscode');
const { AndroidContentProvider } = require('./src/contentprovider');
const { openLogcatWindow } = require('./src/logcat');
const { selectAndroidProcessID } = require('./src/process-attach');
const { selectTargetDevice } = require('./src/utils/device');
// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
@@ -18,6 +19,12 @@ function activate(context) {
vscode.commands.registerCommand('android-dev-ext.view_logcat', () => {
openLogcatWindow(vscode);
}),
// add the device picker handler - used to choose a target device
vscode.commands.registerCommand('PickAndroidDevice', async () => {
const device = await selectTargetDevice(vscode, "Launch", { alwaysShow:true });
// the debugger requires a string value to be returned
return JSON.stringify(device);
}),
// add the process picker handler - used to choose a PID to attach to
vscode.commands.registerCommand('PickAndroidProcess', async () => {
const o = await selectAndroidProcessID(vscode);