Build an App for distribution
Packaging an iTwin Studio App
Section titled “Packaging an iTwin Studio App”-
Create New App:
- Create and build an iTwin Studio App. Follow this tutorial to do so.
- Specify app icon in
app.config.jsonfor shortcut creation.
-
Build and Package: Your template-based iTwin Studio app has a
packagescript in itspackage.jsonwhich can be used for preparing your app for distribution. As a prerequisite to this step, your app must be built viastudio-clifirst, then you can move to the packaging step:- Execute
studio-cli apps buildandstudio-cli apps packagecommands to build and package the app.- Pass the
--devflag to include source maps (useful for debugging but will increase package size significantly). - Pass the
--forQAReleaseflag if releasing to QA. This will keep theauthentication.qaproperties inapp.config.jsonif they exist.
- Pass the
- A
.zipfile should be created.
- Execute
Sharing an iTwin Studio App from a ZIP file
Section titled “Sharing an iTwin Studio App from a ZIP file”Your app is now ready to be shared to other users and they can consume it on their machine where iTwin Studio is installed.
Note that an app in ZIP form must be installed in iTwin Studio before it can be used.
-
Distribution:
- Take the ZIP file created from the previous step and share with others.
-
Installation for Users:
- Users can install the app by running
iTwinStudio apps install <zip>command.
- Users can install the app by running
-
Launch App:
- Users can click on the desktop shortcut or run
iTwinStudio apps run <app-id>command to launch the app.
- Users can click on the desktop shortcut or run
How to publish an iTwin Studio App to the Marketplace
Section titled “How to publish an iTwin Studio App to the Marketplace”-
Setup CI/CD Pipelines:
- See this article on how to start publishing your app from a pipeline
How to automatically update my distributed iTwin Studio App
Section titled “How to automatically update my distributed iTwin Studio App”-
Make Changes:
- Add new features, fix bugs, or make other code changes.
-
Version Increment:
- Increment the version number in the
package.jsonfile, for example, from0.0.0to0.0.1.
- Increment the version number in the
-
Build and Package:
- Execute
studio-cli apps buildandstudio-cli apps packagecommands to build and package the updated app.
- Execute
-
CI & CD Execution:
- Trigger the CI & CD pipelines. Upon successful execution, the new version should be uploaded to the marketplace.
-
Auto-update Test:
- Run the installed app. iTwin Studio will download the latest version during the session and install it during shutdown.
Sharing a published iTwin Studio App
Section titled “Sharing a published iTwin Studio App”-
Distribution:
- You can still share the ZIP file with others, and they can install the app manually. However, if your app has been successfully published, it might be more convenient for end-users to use the iTwin Studio CLI with the command
iTwinStudio apps install <appId>
- You can still share the ZIP file with others, and they can install the app manually. However, if your app has been successfully published, it might be more convenient for end-users to use the iTwin Studio CLI with the command
-
Updates:
- After a user runs your app, iTwin Studio will check for a newer version available in iTwin extensions marketplace. If an update is available, the user will be notified, and the app will be updated during iTwin Studio shutdown.
Publishing Apps in Advance of Studio Releases
Section titled “Publishing Apps in Advance of Studio Releases”When developing apps that depend on new iTwin Studio features, you can publish your app to the marketplace in advance of an iTwin Studio release by using the minStudioVersion field. This ensures users only receive it when their iTwin Studio version is the same or newer than what is specified by your app.
Configuration
Section titled “Configuration”Add the minStudioVersion field to your package.json:
{ "name": "my-app", "version": "2.0.0", "studioApp": { "minStudioVersion": "1.5.0" }}