OfficeDev / teams-toolkit

Developer tools for building Teams apps
Other
458 stars 188 forks source link

Add a launch task for starting the app but not launching a browser #10860

Open therealjohn opened 8 months ago

therealjohn commented 8 months ago

It can be slow and unnecessary to constantly launch a new browser and add the app every time you want to iterate on your Teams app. This is only really necessary if the manifest changes. Instead, a simpler launch profile that just starts the app and does not launch Teams in a browser can be used in combination with an already open Teams browser or desktop client.

For example: image

Use the Start Debugging launch task to start the app, connect the debugger, etc. and then alt-tab or switch over to a desktop Teams client.

  1. If the app wasn't uploaded yet, or the manifest changed, use the Apps > Manage your apps > Upload a custom app button. image
  1. If the app is already added and the manifest hasn't changed, switch back to your app in a Teams client and continue iterating.

This is much faster than waiting for the browser to launch, authenticate, Add app dialog, etc.

In the new 2.1 Teams desktop client its also fast to switch accounts or tenants, so if you are debugging an app in a different account you can switch to that easily.

All that was needed to support this was just modifying the .vscode/launch.json to have this:

"compounds": [
        {
            "name": "Start Debugging",
            "configurations": [
                "Attach to Local Service"
            ],
            "preLaunchTask": "Start Teams App Locally",
            "presentation": {
                "group": "1",
                "order": 0
            },
            "stopAll": true
        },
...
microsoft-github-policy-service[bot] commented 8 months ago

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.