> 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/integrations/circleci-integration.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# CircleCI integration

Autify provides the official CircleCI Orb to upload a build and run a test plan easily from your CircleCI workflow.

## Getting started

This document describes how to use our CircleCI integrations with your Git repository step-by-step.

### Prerequisites

First, we assume you already have CircleCI workflow to build your application. We'll add an Autify test job right after the build job to confirm the newly built application doesn't break the end-to-end experience.

Secondly, you need to create a test plan on [Autify NoCode Mobile](https://mobile-app.autify.com). Please note the URL of your test plan e.g. `https://mobile-app.autify.com/projects/AAA/test_plans/BBB` and we'll use it later.

You also need to [create a personal access token](https://help.autify.com/nocode-mobile/en/using-autify-nocode-mobile/integrations/api-integration.md#api-authentication-token-generation-method) of Autify NoCode Mobile. Please note the generated token somewhere so that we can store the value on Environment Variables later.

*Note: Since the personal access token is associated with a single user, we recommend you to create a machine user in your organization and use its personal access token for CI/CD integration.*

### Store personal access token on Environment Variables

Store the personal access token you generated above on Environment Variables by following [CircleCI's document](https://circleci.com/docs/env-vars). You can use an arbitrary name for the Environment Variable but if you name `AUTIFY_MOBILE_ACCESS_TOKEN`, you don't have to specify the name later because this is the default name. Assuming you named so here.

### Add CircleCI job to upload a build and run Autify NoCode Mobile

Finally, let's add a new step to your existing CircleCI workflow. See the examples below. The `autify-test-url` value should be the URL you noted above.

* [autify/autify-mobile CircleCI Orb](https://circleci.com/developer/orbs/orb/autify/autify-mobile)

***

Upload a new build file and start a test (no waiting for the finish of the test):

```yaml
orbs:
  android: circleci/android@2.0
  autify-mobile: autify/autify-mobile@3

jobs:
  # Example build jobs. Needs to persist the build file to workspace.
  build-android:
    executor:
      name: android/android-machine
    steps:
      - ...
      - run: ./gradlew assembleRelease
      - persist_to_workspace:
          paths:
            - android-release.apk
          root: app/build/outputs/apk/release
  build-ios:
    macos:
      xcode: 13.4.1
    steps:
      - ...
      - run: xcodebuild -configuration Debug -target hello-world -arch x86_64 -sdk iphonesimulator
      - persist_to_workspace:
          paths:
            - hello-world.app
          root: build/Debug-iphonesimulator

workflows:
  test-run-andriod:
    jobs:
      - build-android
      - autify-mobile/test-run:
          requires:
            - build-android
          autify-test-url: 'https://mobile-app.autify.com/projects/AAA/test_plans/BBB'
          build-path: android-release.apk

  test-run-ios:
    jobs:
      - build-ios
      - autify-mobile/test-run:
          requires:
            - build-ios
          autify-test-url: 'https://mobile-app.autify.com/projects/AAA/test_plans/BBB'
          build-path: hello-world.app
```

If you want to wait until the test finishes or timed out:

```yaml
    jobs:
      - autify-mobile/test-run:
          ...
          wait: true
          timeout: 300
```

**CAVEAT: This will consume your CircleCI build minutes while waiting. Be careful when extending the timeout value.**

Just upload a new build file (`workspace-id` is the id right after `/projects/` in the URL you noted above):

```yaml
    # Android
    jobs:
      - build-android
      - autify-mobile/build-upload:
          requires:
            - build-android
          build-path: android-release.apk
          workspace-id: AAA
          
    ## iOS
    jobs:
      - build-ios
      - autify-mobile/build-upload:
          requires:
            - build-ios
          build-path: hello-world.app
         workspace-id: AAA
```

## Conclusion

By using [Autify's CircleCI Orb](https://circleci.com/developer/orbs/orb/autify/autify-mobile), you can automatically run a test plan after build so that you can detect regressions right away and take an appropriate actions without wasting time.


---

# 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/integrations/circleci-integration.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.
