> For the complete documentation index, see [llms.txt](https://help.autify.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.autify.com/nocode-mobile/en/using-autify-nocode-mobile/scenario-creation-and-maintenance/environment-variables.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# Environment variables

## What are Environment Variables?

**Note: Before using this feature, a developer must define the code that handles boot arguments.**

On iOS, *environment variables* refer to boot variables. The behavior of this feature changes depending on the predefined code in the app. After the code is changed, you can use this feature to pass specific values to the app. For example, you can use environment variables to:

* Change the server endpoint for each scenario
* Change the application state for each scenario

## App Prerequisites

To use this feature, the app must be able to handle boot variables. Below is a sample code in Swift. The value of `<Key>` in the sample code must be the same as the Key registered in Autify.

```
#if DEBUG 
    if ProcessInfo.processInfo.environment["<Key>"] ! = nil { 
        // Do something 
    } 
#endif
```

For more information on Swift's ProcessInfo class, please refer to Apple's official documentation.

* [ProcessInfo | Apple Developer](https://developer.apple.com/documentation/foundation/processinfo)

## How to Create Environment Variables

### iOS

1. Click \[Environment Variables] on the left sidebar

   ![](https://1041389054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj0BSsfTevAGpY0hwBHT7%2Fuploads%2Fgit-blob-762e1d497f2e2ccebeba26e5b423c1a9614d189e%2Fev_en.png?alt=media)
2. Click the **\[iOS]** tab
3. Click **\[Create Environment Variables]** and add the required data.

![](https://1041389054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj0BSsfTevAGpY0hwBHT7%2Fuploads%2Fgit-blob-91972f9bbba20763469c2e46f235caa63e7c1927%2Fios_create_EV.png?alt=media)

Let's take a look at what each input item means.

* Name
  * A unique value to identify the environment variable you are creating
* Key
  * Variable name
* Value
  * Variable value
* Description (optional)
  * Description of the environment variable

4. Click **\[Create]**

### Android

{% hint style="warning" %}
When using environment variables in Android, **you must specify&#x20;*****appPackage*****&#x20;and&#x20;*****appActivity***.
{% endhint %}

1. Click \[Environment Variables] on the left sidebar
2. Click the **\[Android]** tab
3. Click **\[Create Startup Activity]**

   ![](https://1041389054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj0BSsfTevAGpY0hwBHT7%2Fuploads%2Fgit-blob-94aa539f0f51c4ba83ff5288971883538a07d951%2Fcreate_startupActivity_En.png?alt=media)
4. Add the required data ※As mentioned above, **you must specify&#x20;*****appPackage*****&#x20;and&#x20;*****appActivity*** when using environment variables in Android. Please select them in the *Key* section and create each.

   ![](https://1041389054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj0BSsfTevAGpY0hwBHT7%2Fuploads%2Fgit-blob-881cabfcc8f1abf6e3d674b78de241443174adba%2Fkey_en.png?alt=media)

   Description of commonly used keys and values:

   * **appPackage (Required)**
     * Package name
     * Example value:

       `com.example.app`
   * **appActivity (Required)**
     * Activity name
     * Example value:

       `.ExampleActivity`
   * **optionalIntentArguments (Optional)**

     * Intent Argument. When using this key, its value must include the option as described in the [*Specification for intent arguments* section in the official documentation](https://developer.android.com/studio/command-line/adb#IntentSpec).
     * Example values:

     | Name      | Key                     | Value                     |
     | --------- | ----------------------- | ------------------------- |
     | Example 1 | optionalIntentArguments | --es API\_URL example.com |
     | Example 2 | optionalIntentArguments | --el USER\_ID 127         |
5. Click **\[Create]**

## How to edit and delete environment variables

You can delete and edit environment variables on the Environment Variable List Page.

![](https://1041389054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj0BSsfTevAGpY0hwBHT7%2Fuploads%2Fgit-blob-7d1735261f4887e5ef95af071d41b06e5909c9bc%2FEnvironmentVariables_3.png?alt=media)

## How to Use Environment Variables in Scenarios

You can use environmental variables on the build file selection page in new scenarios, existing scenarios, or when creating a new Step Group.

1. Select the target build file.
2. Select the \[Set environment variables] button.

   ![](https://1041389054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj0BSsfTevAGpY0hwBHT7%2Fuploads%2Fgit-blob-c16dc778f7080414cfb6daa85f8dcc0d0c789e63%2FEnvironmentVariables_4.png?alt=media)
3. Select the environment variable you want to use.

   ![](https://1041389054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj0BSsfTevAGpY0hwBHT7%2Fuploads%2Fgit-blob-efcf28118c21acb8aa30fe6ea59228e94a0642f8%2Fselect_variables.png?alt=media)
4. Click \[Select].

## Others

* There is no upper limit to the number of environment variables that you can have.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.autify.com/nocode-mobile/en/using-autify-nocode-mobile/scenario-creation-and-maintenance/environment-variables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
