In the mabl CLI, you can manage the URLs and mobile build files that are associated with a test environment. These represent the URLs and build files that are utilized in plan runs.
Managing URLs
Use mabl environments urls add
to add one or more new web or API URLs to an app-environment pair. To get the required environment and application IDs, run mabl environments list
and mabl applications list
.
# Associate an application and environment with a new web application URL
mabl environments urls add <env-id> --application-id <app-id> --app-url https://www.url1.com
# Associate an application and environment with a new API URL
mabl environments urls add <env-id> --application-id <app-id> --api-url https://www.api.example.com
To see all of the URLs and mobile builds associated with an app-environment pair, run mabl environments urls list
:
mabl environments urls list <env-id> --application-id <app-id>
Managing build files
In the CLI, you can upload mobile build files to your workspace using the command mabl mobile-build-files upload
.
mabl mobile-build-files upload <relative-path-to-build>
The CLI returns a build file ID ending in -maf
. Use this build file ID with one of the following commands to associate the build with an app-environment pair:
Other ways to access the build file ID include:
- Run
mabl mobile-build-files list
in the CLI to see IDs for all build files - Go to Configuration > Mobile build files in the app and click on the CLI icon next to the build file:
Accessing the build file ID from the app
mabl environments build-files update
Use mabl environments build-files update
to swap out the mobile build file associated with an app-environment pair. This command is particularly useful when you want to update the default build for scheduled plan runs.
mabl environments build-files update <env-id> --application-id <app-id> --build-file-id <build-file-id>
If a different build file is already associated with the app-environment pair, the CLI replaces it with the new build file. This process is separate for Android and iOS. For example, running mabl environments build-files update
with an Android build only updates the Android build file associated with the app-environment pair. The same behavior applies for iOS builds.
If you want to run plans ad hoc with a build file just once to test it out, you can create a deployment event instead and use a build file override argument: --android-app-file-id
or --ios-app-file-id
.
Note
The mabl environments build-files update
command cannot update app-environment pairs that are already associated with multiple build files. For example, if two iOS builds are already associated with the app-environment pair, you cannot update them from the CLI. Use the mabl app instead: Configurations > Applications.
mabl environments build-files add
Use mabl environments build-files add
to add a new build file association to an app-environment pair:
mabl environments build-files add <env-id> --application-id <app-id> --build-file-id <build-file-id>