AppForShareGet a token

Upload from CI

Codemagic

Codemagic runs publishing scripts after the build. Add one that uploads the file from your artifacts; Node is already on Codemagic machines.

1. Add your token

Create an API token under Dashboard, Settings, API tokens (Pro and Team). Team or app settings, Environment variables, add APPFORSHARE_TOKEN as Secure in a group (for example appforshare), and import the group in the workflow. The CLI reads it from the APPFORSHARE_TOKEN environment variable.

2. codemagic.yaml

Codemagic has no commit message variable, so the script reads it with git log.

workflows:
  android-beta:
    name: Android beta
    environment:
      groups: [appforshare]
      flutter: stable
    scripts:
      - flutter build apk --release
    artifacts:
      - build/app/outputs/flutter-apk/app-release.apk
    publishing:
      scripts:
        - name: Share with testers
          script: |
            npx --yes appforshare upload build/app/outputs/flutter-apk/app-release.apk \
              --notes "$(git log -1 --pretty=%B)" --channel beta

Good to know

  • For iOS, run flutter build ipa --export-method ad-hoc and upload build/ios/ipa/*.ipa.
  • Add --channel beta to keep one stable link for testers, and --fail-on blocked to stop the pipeline when the store readiness check finds a blocker (exit code 2; the build stays uploaded).
  • The command prints the install link. Add --json for url, slug, version and channel as JSON. All options are on Upload from CI.

Questions

Can I upload the .aab Codemagic builds for Google Play?
Yes. AppForShare turns an .aab into one APK testers can install, signed with a test key made for your account or with your own upload key on Pro and Team.
Does it work with the Workflow Editor instead of YAML?
Yes. Add the same command as a post-publish script and the token as an environment variable.

Other CI systems

GitHub Actions and FastlaneCircleCIGitLab CIBitbucket PipelinesJenkinsAzure PipelinesXcode CloudBitriseExpo EAS