mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-22 17:39:19 +00:00
Version 1.1 improvements (#88)
* fix 0 alignment in binary xml decoding * output reason for APK manifest read failure * try and match package name against process name when determining which pid to attach * make post launch pause user-configurable * code tidy, jsdocs and types * more types in expression parse classes * fix issue with expandable objects not evaluating * update build task example * fix package/type evaluation * improve handling of targetDevice and processID combinations * show full call stack by default * implement a queue for evaluations * improve performance of retrieving single fields * check root term identifiers against this fields
This commit is contained in:
25
extension.js
25
extension.js
@@ -20,14 +20,33 @@ function activate(context) {
|
||||
openLogcatWindow(vscode);
|
||||
}),
|
||||
// add the device picker handler - used to choose a target device
|
||||
vscode.commands.registerCommand('PickAndroidDevice', async () => {
|
||||
vscode.commands.registerCommand('PickAndroidDevice', async (launchConfig) => {
|
||||
// if the config has both PickAndroidDevice and PickAndroidProcess, ignore this
|
||||
// request as PickAndroidProcess already includes chooosing a device...
|
||||
if (launchConfig && launchConfig.processId === '${command:PickAndroidProcess}') {
|
||||
return '';
|
||||
}
|
||||
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);
|
||||
vscode.commands.registerCommand('PickAndroidProcess', async (launchConfig) => {
|
||||
// if the config has a targetDevice specified, use it instead of choosing a device...
|
||||
let target_device = '';
|
||||
if (launchConfig && typeof launchConfig.targetDevice === 'string') {
|
||||
target_device = launchConfig.targetDevice;
|
||||
}
|
||||
const explicit_pick_device = target_device === '${command:PickAndroidDevice}';
|
||||
if (!target_device || explicit_pick_device) {
|
||||
// no targetDevice (or it's set to ${command:PickAndroidDevice})
|
||||
const device = await selectTargetDevice(vscode, 'Attach', { alwaysShow: explicit_pick_device });
|
||||
if (!device) {
|
||||
return JSON.stringify({status: 'cancelled'});
|
||||
}
|
||||
target_device = device.serial;
|
||||
}
|
||||
const o = await selectAndroidProcessID(vscode, target_device);
|
||||
// the debugger requires a string value to be returned
|
||||
return JSON.stringify(o);
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user