AppForShareGet a token

Integrations

fastlane

The fastlane plugin fastlane-plugin-appforshare uploads the .ipa or .apk your lane just built and gives you an install link and QR page for testers. It can put the build into a channel, share it with tester groups, read the store readiness check and stop the lane on a blocker. More actions manage testers, groups and iPhone UDIDs. Open source under the MIT license. Pro and Team.

  1. 1. Add the plugin

    In your project run fastlane add_plugin appforshare. fastlane adds it to the Pluginfile and installs the gem fastlane-plugin-appforshare from RubyGems.

  2. 2. Set your token

    Create an API token under Dashboard, Settings, API tokens (Pro and Team) and set it as APPFORSHARE_TOKEN in your shell or CI secrets.

  3. 3. Call appforshare in a lane

    Put appforshare after gym or gradle. Without file: it takes the .ipa from gym or the .apk from gradle, uploads it, waits until it is ready and prints the install link.

Example lanes

fastlane add_plugin appforshare
export APPFORSHARE_TOKEN=afs_...
# fastlane/Fastfile
platform :ios do
  lane :beta do
    gym(export_method: "ad-hoc")
    appforshare(
      release_notes: "Fixes the login crash",
      channel: "beta",
      fail_on: "blocked"
    )
    puts lane_context[SharedValues::APPFORSHARE_URL]
  end
end

platform :android do
  lane :beta do
    gradle(task: "assembleRelease")
    appforshare(channel: "beta", groups: "Client QA")
  end
end

appforshare action options

Every option can also be set with its environment variable.

api_token: (APPFORSHARE_TOKEN)
API token. Required.
file: (APPFORSHARE_FILE)
Path to the .ipa or .apk. Defaults to the gym output (IPA_OUTPUT_PATH) or the gradle output (GRADLE_APK_OUTPUT_PATH).
release_notes: (APPFORSHARE_RELEASE_NOTES)
Shown to testers on the install page.
channel: (APPFORSHARE_CHANNEL)
Put the build into a channel such as beta or live, made on first use. Its link always opens the newest build in it.
groups: (APPFORSHARE_GROUPS)
Share the build with these tester groups when it is ready (Team).
testers: (APPFORSHARE_TESTERS)
Share the build with these tester emails when it is ready (Team).
email: (APPFORSHARE_EMAIL)
Email the install link to up to 5 addresses when it is ready.
password: (APPFORSHARE_PASSWORD)
Protect the install link with a password (4 to 128 characters).
fail_on: (APPFORSHARE_FAIL_ON)
blocked or review: fail the lane on the store readiness check. The build stays uploaded and its link works.
api_url: (APPFORSHARE_API)
API origin, https://appforshare.io by default.

Lane context after the upload

SharedValues::APPFORSHARE_URL
Install link of the build (also the return value)
SharedValues::APPFORSHARE_SLUG
Share code of the build
SharedValues::APPFORSHARE_READINESS
Store readiness status: ready, review, blocked or unknown
SharedValues::APPFORSHARE_CHANNEL_URL
Channel link, when you passed channel:

Testers, groups, UDIDs and the newest build

appforshare_add_testers(emails:, file:, project:, groups:, notify:)
Add testers, optionally to a project and tester groups. notify: false skips the invite email (Team).
appforshare_remove_testers(emails:, file:, project:)
Remove testers, or with project: only the access you gave them there (Team).
appforshare_create_group(name:, project:, emails:, file:, notify:)
Make a tester group, optionally on a project and with members (Team).
appforshare_delete_group(name:)
Delete a group. Its members stay testers (Team).
appforshare_udids(output_file:)
Write the iPhone and iPad UDIDs testers sent to a file in Apple's format. Sets APPFORSHARE_UDIDS_FILE.
appforshare_latest(app:, platform:, channel:)
Newest build: sets APPFORSHARE_LATEST_VERSION, APPFORSHARE_LATEST_BUILD_NUMBER and APPFORSHARE_LATEST_URL.

New iPhones into the ad hoc profile:

lane :devices do
  appforshare_udids(output_file: "devices.txt")
  register_devices(devices_file: "devices.txt")
  match(type: "adhoc", force_for_new_devices: true)
end

Next Android version code from the newest build:

lane :beta_android do
  latest = appforshare_latest(app: "com.example.shop", platform: "android")
  increment_version_code(version_code: latest["versionCode"].to_i + 1)
  gradle(task: "assembleRelease")
  appforshare(groups: "Client QA", testers: "[email protected]")
end

Questions

Which plan do I need?
The plugin uses an API token, which comes with Pro and Team. Tester and group options and actions need Team.
Which builds can testers install from the link?
iOS builds signed Ad Hoc, Development or Enterprise, so use gym(export_method: "ad-hoc") or match type adhoc for testers. Android .apk files install directly. An App Store signed .ipa can still be uploaded and, on Pro and Team, sent to TestFlight by an Admin.
What does fail_on do?
After the upload the action reads the store readiness check of the build. fail_on: "blocked" fails the lane when the check finds a blocker, fail_on: "review" also when something needs a look. The build stays uploaded and the error message has its link. The check is guidance about current App Store and Google Play rules, not a promise of approval.
Does it handle large builds?
Yes. The upload goes in chunks and continues where it stopped after a dropped connection, then the action waits until the build is ready.
How do I add new iPhones to the ad hoc profile?
Run appforshare_udids, then register_devices and match with force_for_new_devices, as in the devices lane above. Testers send their UDID with the free finder at appforshare.io/udid.
Can I post the link to Slack from the lane?
Yes. Read lane_context[SharedValues::APPFORSHARE_URL] in fastlane's slack action, or add a Slack integration in AppForShare and every new build posts itself.

Not using fastlane? The same upload runs from the CLI and the GitHub Action. Moving from another service's fastlane actions? See Move from Firebase. Every other tool is on Integrations.