{
    "name": "android-dev-ext",
    "displayName": "Android",
    "description": "Android debugging support for VS Code",
    "version": "1.1.0",
    "publisher": "adelphes",
    "preview": true,
    "license": "MIT",
    "engines": {
        "vscode": "^1.24.0"
    },
    "categories": [
        "Debuggers"
    ],
    "icon": "images/ade.png",
    "galleryBanner": {
        "color": "#5c2d91",
        "theme": "dark"
    },
    "activationEvents": [
        "onCommand:android-dev-ext.view_logcat",
        "onCommand:PickAndroidDevice",
        "onCommand:PickAndroidProcess",
        "onLanguage:java"
    ],
    "repository": {
        "type": "git",
        "url": "https://github.com/adelphes/android-dev-ext"
    },
    "main": "./extension",
    "contributes": {
        "configuration": {
            "type": "object",
            "title": "Android",
            "properties": {
                "android-dev-ext.languageSupport": {
                    "scope": "resource",
                    "type": "boolean",
                    "default": "true",
                    "description": "Enable Java language support for Android"
                },
                "android-dev-ext.appSourceRoot": {
                    "scope": "resource",
                    "type": "string",
                    "default": "app/src/main",
                    "description": "Workspace-relative path to the app source files. The specified folder should contain AndroidManifest.xml."
                },
                "android-dev-ext.subscriptionKey": {
                    "scope": "application",
                    "type": "string",
                    "default": ""
                },
                "android-dev-ext.trace": {
                    "scope": "resource",
                    "type": "boolean",
                    "default": false,
                    "description": "Enable diagnostic trace logging in the extension output."
                }
            }
        },
        "commands": [
            {
                "command": "android-dev-ext.view_logcat",
                "title": "Android: View Logcat"
            }
        ],
        "breakpoints": [
            {
                "language": "java"
            },
            {
                "language": "kotlin"
            }
        ],
        "debuggers": [
            {
                "type": "android",
                "label": "Android",
                "program": "./src/debugMain.js",
                "runtime": "node",
                "configurationAttributes": {
                    "launch": {
                        "required": [
                            "appSrcRoot",
                            "apkFile",
                            "adbPort"
                        ],
                        "properties": {
                            "amStartArgs": {
                                "type": "array",
                                "description": "Custom arguments to pass to the Android application manager to start the app. Run `adb shell am` to show valid arguments. Note that `-D` is required to enable debugging.\r\nBe careful using this option - you must specify the correct parameters or the app will not start.\r\n\r\nThis option is incompatible with the `launchActivity` option.",
                                "default": [
                                    "-D",
                                    "--activity-brought-to-front",
                                    "-a android.intent.action.MAIN",
                                    "-c android.intent.category.LAUNCHER",
                                    "-n package.name/launch.activity"
                                ]
                            },
                            "appSrcRoot": {
                                "type": "string",
                                "description": "Location of the App source files. This value must point to the root of your App source tree (containing AndroidManifest.xml)",
                                "default": "${workspaceRoot}/app/src/main"
                            },
                            "apkFile": {
                                "type": "string",
                                "description": "Fully qualified path to the built APK (Android Application Package)",
                                "default": "${workspaceRoot}/app/build/outputs/apk/debug/app-debug.apk"
                            },
                            "adbPort": {
                                "type": "integer",
                                "description": "Port number to connect to the local ADB (Android Debug Bridge) instance. Default: 5037",
                                "default": 5037
                            },
                            "autoStartADB": {
                                "type": "boolean",
                                "description": "Automatically launch 'adb start-server' if not already started. Default: true",
                                "default": true
                            },
                            "callStackDisplaySize": {
                                "type": "integer",
                                "description": "Number of entries to display in call stack views (for locations outside of the project source). 0 shows the entire call stack. Default: 1",
                                "default": 1
                            },
                            "launchActivity": {
                                "type": "string",
                                "description": "Manually specify the activity to run when the app is started.",
                                "default": ""
                            },
                            "logcatPort": {
                                "type": "integer",
                                "description": "Port number to use for the internal logcat websocket link. Changes to this value only apply when the extension is restarted. Default: 7038",
                                "default": 7038
                            },
                            "manifestFile": {
                                "type": "string",
                                "description": "Overrides the default location of AndroidManifest.xml",
                                "default": "${workspaceRoot}/app/src/main/AndroidManifest.xml"
                            },
                            "pmInstallArgs": {
                                "type": "array",
                                "description": "APK install arguments passed to the Android package manager. Run 'adb shell pm' to show valid arguments. Default: [\"-r\"]",
                                "default": [
                                    "-r"
                                ]
                            },
                            "postLaunchPause": {
                                "type": "number",
                                "description": "Time in milliseconds to wait after launching an app before attempting to attach the debugger. Default: 1000",
                                "default": 1000
                            },
                            "staleBuild": {
                                "type": "string",
                                "description": "Launch behaviour if source files have been saved after the APK was built. One of: [\"ignore\" \"warn\" \"stop\"]. Default: \"warn\"",
                                "default": "warn"
                            },
                            "targetDevice": {
                                "type": "string",
                                "description": "Target Device ID (as indicated by 'adb devices'). Use this to specify which device is used for deployment when multiple devices are connected.",
                                "default": "${command:PickAndroidDevice}"
                            },
                            "trace": {
                                "type": "boolean",
                                "description": "Set to true to output debugging logs for diagnostics",
                                "default": false
                            }
                        }
                    },
                    "attach": {
                        "required": [
                            "appSrcRoot",
                            "adbPort",
                            "processId"
                        ],
                        "properties": {
                            "appSrcRoot": {
                                "type": "string",
                                "description": "Location of the App source files. This value must point to the root of your App source tree (containing AndroidManifest.xml)",
                                "default": "${workspaceRoot}/app/src/main"
                            },
                            "adbPort": {
                                "type": "integer",
                                "description": "Port number to connect to the local ADB (Android Debug Bridge) instance. Default: 5037",
                                "default": 5037
                            },
                            "processId": {
                                "type": "string",
                                "description": "PID of process to attach to.\n\"${command:PickAndroidProcess}\" will display a list of debuggable PIDs to choose from during launch.",
                                "default": "${command:PickAndroidProcess}"
                            },
                            "targetDevice": {
                                "type": "string",
                                "description": "Target Device ID (as indicated by 'adb devices'). Use this to specify which device is used when multiple devices are connected.",
                                "default": "${command:PickAndroidDevice}"
                            },
                            "trace": {
                                "type": "boolean",
                                "description": "Set to true to output debugging logs for diagnostics",
                                "default": false
                            }
                        }
                    }
                },
                "initialConfigurations": [
                    {
                        "type": "android",
                        "request": "launch",
                        "name": "Android launch",
                        "appSrcRoot": "${workspaceRoot}/app/src/main",
                        "apkFile": "${workspaceRoot}/app/build/outputs/apk/debug/app-debug.apk",
                        "adbPort": 5037
                    },
                    {
                        "type": "android",
                        "request": "attach",
                        "name": "Android attach",
                        "appSrcRoot": "${workspaceRoot}/app/src/main",
                        "adbPort": 5037,
                        "processId": "${command:PickAndroidProcess}"
                    }
                ],
                "configurationSnippets": [
                    {
                        "label": "Android: Launch Application",
                        "description": "A new configuration for launching an Android app debugging session",
                        "body": {
                            "type": "android",
                            "request": "launch",
                            "name": "${2:Android Launch}",
                            "appSrcRoot": "^\"\\${workspaceRoot}/app/src/main\"",
                            "apkFile": "^\"\\${workspaceRoot}/app/build/outputs/apk/debug/app-debug.apk\"",
                            "adbPort": 5037
                        }
                    },
                    {
                        "label": "Android: Attach to Process",
                        "description": "A new configuration for attaching to a running Android app process",
                        "body": {
                            "type": "android",
                            "request": "attach",
                            "name": "${2:Android Attach}",
                            "appSrcRoot": "^\"\\${workspaceRoot}/app/src/main\"",
                            "adbPort": 5037,
                            "processId": "^\"\\${command:PickAndroidProcess}\""
                        }
                    }
                ],
                "variables": {}
            }
        ]
    },
    "scripts": {
        "postinstall": "cd langserver && npm install && cd ..",
        "test": "node ./node_modules/vscode/bin/test"
    },
    "dependencies": {
        "long": "^4.0.0",
        "unzipper": "^0.10.10",
        "uuid": "^3.3.2",
        "vscode-debugadapter": "^1.40.0",
        "vscode-debugprotocol": "^1.40.0",
        "vscode-languageclient": "6.1.3",
        "ws": "^7.1.2",
        "xmldom": "^0.1.27",
        "xpath": "^0.0.27"
    },
    "devDependencies": {
        "@types/mocha": "^5.2.5",
        "@types/node": "^10.12.5",
        "@types/vscode": "^1.46.0",
        "eslint": "^5.9.0",
        "mocha": "^5.2.0",
        "typescript": "^3.8.3"
    }
}
