Getting started with Testmagic

Feb 26, 2019

At Flutter Live conference in 2018, Codemagic was first introduced as the official CI/CD solution for Flutter apps. Since then, Codemagic has rolled out many great features, such as automatic code signing, to allow for smooth and painless building and deployment of Flutter apps. In order to get the application on the devices, there were a few options, like publishing the app artifacts to email or Slack. However, Codemagic now has a better way for users to download the builds on the devices with the Testmagic app. In this post, we will briefly cover what is Testmagic and how to set up Testmagic for Codemagic.

What is Testmagic

Testmagic is a simple and free mobile app for easy distribution and testing of your Android and iOS beta releases. It enables you to effortlessly access and download your CI/CD builds on connected devices and distribute builds by sharing a download link. You can also collect feedback and upload screenshots to make your apps work like a charm.

You can treat Testmagic as a tool similar to HockeyApp or Fabric where non-technical people can download builds on mobile devices. At the moment, Testmagic is integrated with Codemagic, but it can later be used for accessing mobile builds from any CI server. You can read more about the vision of Testmagic here.

Testmagic for Android is available for download on Google Play Store. Testmagic for iOS can be currently downloaded via TestFlight (request access to it on the #testmagic channel in our Slack workspace) until it’s made publicly available. You can install the Testmagic app onto iOS or Android devices, just like normal apps.

Connecting Testmagic app with Codemagic

Once you have the Testmagic app installed on a device, you need to connect it with your Codemagic account. On launching Testmagic, you’ll see the following screen asking to scan the QR code.

You can get the QR code from Codemagic and scan it in the app.

Getting the QR code and adding test devices

In order to get the QR code, you need to sign in to Codemagic using your GitHub, Gitlab or Bitbucket credentials.

  1. Open the User settings in the bottom left corner where you can see your profile picture.
  2. Scroll down to the Test devices section.
  3. Click the Add device button. You will then see a QR code which will have to be scanned by the Testmagic app.

As soon as a device is added to Codemagic, you can access all the builds in the Testmagic app on that device.

Getting an installable build

In order to get the iOS mobile build on real devices, you need to set up code signing in Codemagic and add devices to provisioning profiles to receive signed iOS debug builds. Android builds don’t have to be signed for installation, but signing is required when you’re building for release. Flutter documentation has excellent guides on how to prepare iOS and Android builds for deployment.

You can set up code signing for both iOS and Android builds in the Publish section of the app settings. Codemagic offers two options for signing iOS apps. With automatic code signing (see how to use automatic code signing here), you are required to provide your Apple Developer portal login credentials and Codemagic will generate all the required code signing assets, including a provisioning profile containing all the registered devices in your Apple Developer portal account, on your behalf. The other option is manual code signing which requires you to upload certificates and provisioning profiles manually.

The Android app signing process requires uploading the keystore file along with providing the keystore password, key alias and key password to sign the apps.

Managing provisioning profiles for iOS debug builds

In this section, we will give you a quick overview of how to manage your provisioning profiles for manual code signing. You can read about automatic code signing here.

iOS provisioning profiles contain the necessary information for code signing the app, like team ID, bundle ID and the devices on which the app can run. In order to be able to install a beta build on real devices, you should have these devices added to the provisioning profiles via App Store Connect or in the Certificates and Profiles section in Apple developer portal. Note that there’s no need to add devices to the provisioning profile in the case of release builds for App Store distribution.

If you have a certificate and app identifier ready, you can create a new profile or edit an existing one to add the device to the profile. Once the device is added to the profile, we can rebuild the app using the new provisioning profile to get the build on the device. Read more about the process of creating provisioning profiles in this blog post.

Note that once you have created a development certificate, an app bundle identifier and a provisioning profile in Apple Developer portal, you must update your Flutter project’s code signing settings in Xcode as mentioned in Flutter’s docs. Instead of using Xcode generated profiles, make sure to use the provisioning profile containing the devices you need.

You can then upload your development certificate and provisioning profile to Codemagic and run a debug build of your app to receive a signed .ipa file that can be installed on a real device.

Note: The process of creating certificates and profiles is tedious. Please ask help from a team member who manages the Apple developer portal.

Downloading builds from Testmagic

Once the build is finished successfully, you’ll receive a push notification on your device and can immediately download the app artifact by clicking the arrow icon.

On clicking the arrow icon, you will see the pop up to download the build on your mobile device. You can then download and install the app on your device.

Instead of connecting all testing devices to your account on Codemagic, you can share the link to download the build straight from Testmagic. It’s an easy way to engage testers or have your clients preview the app.

Select your app and open a build.

Tap on Artifacts. A list of available sharing options will be displayed.

Choose one of the options for sharing the build. For example, you can share the link with all the people in a Slack channel.

Once you complete the action, you’ll see that the message has been sent.

That’s it, you’re all done! On clicking the link, users will immediately see a dialog for downloading the app.

Providing feedback on the build

With the Testmagic app, you can also provide feedback about the build. You can enter text and upload screenshots.

Tap Feedback in the build details and you will see the + sign to add your feedback.

After you enter your feedback, tap Submit to save and send the feedback to your team.

Once feedback is submitted in Testmagic, we can see the feedback reports from all users in the reports view.

Viewing feedback on Codemagic

All the reported feedback will be available on Codemagic. Open the build and scroll down to the Testmagic reports section to see the feedback that has been reported via Testmagic.

What next

As of now, Testmagic is a service for distributing and downloading the beta testing builds on mobile devices. However, there are exciting things lined up for Testmagic, such as integrations with other CI/CD tools, like Nevercode, as well as advanced testing related features, like the ability to see the build logs and crash reports.

Try Testmagic and share your feedback with us!