Running your App
iTwin Studio apps can be executed in a variety of ways. Let’s explore some of the options.
Run your code in iTwin Studio:
Section titled “Run your code in iTwin Studio:”A compiled iTwin Studio app can be launched by passing the app.config.json path, or the path for the directory where the app.config.json is located to iTwin Studio executable. The path can be either relative or absolute.
- Create and build an iTwin Studio App. Follow steps in articles to create and build apps if you haven’t created one already.
- Assuming iTwinStudio is installed on your machine and is available on PATH, open a terminal, then run the following command
Terminal window iTwinStudio ./path/to/my/app/app.config.json - Or
Terminal window iTwinStudio ./path/to/my/app - This should start iTwin Studio and load your application
Debug your code in VS Code
Section titled “Debug your code in VS Code”Your template based app has a launch config that allows you to launch iTwin Studio and attach frontend and backend processes with hot reloading enabled, as long as you have developer support enabled.
package.json has a script called dev which allows you to execute your app in watch mode.
We will discuss it in detail in debug article, but for now, it’s enough to note that this script will be invoked at the start of debug session. As such, debugging can be started simply by doing the following:
- Open your app folder in VSCode
- Select ‘debug in Studio’ launch config
- Start debugging via run->Start Debugging
Running an installed app
Section titled “Running an installed app”We’ll cover ‘Installed Apps’ concept in publishing section, but if you have an app installed with iTwin Studio, it can be started with the following command:
iTwinStudio apps run <<App-ID>>