iOS Setup

As you can see bellow, creating a new application is pretty straightforward.

In order to use AppCenter’s services we have to install its SDK. In our project’s path we type:

>> yarn add appcenter appcenter-analytics appcenter-crashes --exact

For linking AppCenter’s packages, we can use Pods or do it manually. We’ll go with Pods this time. But you can do it
manually if you want to, I did that on a recent project without many headaches.

We have to make sure that we’re using the latest version of Pods.

Being placed under /ios path we type:

>> pod init

Below is my Podfile, but heads up: your AppCenter’s services' versions might be different from mine.

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'AppCenterTutorial' do
pod 'AppCenter/Crashes', '~> 1.12.0'
pod 'AppCenter/Analytics', '~> 1.12.0'
pod 'AppCenterReactNativeShared', '~> 1.11.0'
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for AppCenterTutorial
platform :ios, '9.0'
target 'AppCenterTutorial-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'AppCenterTutorialTests' do
inherit! :search_paths
# Pods for testing
end
end

Once we have Pods initialized into the project, we can link AppCenter’s packages automatically by typing:

>> react-native link

When prompted, for Android we don’t have to submit any app secret at this point, we’ll add it afterwards. For iOS though, we make sure that we’re using the one generated on AppCenter. I’m talking about this one:

As stated above, we must connect to our Github repository.

Once we’re connected to Github, we can configure any branch we want. Let’s go for the master one.

We have to make sure we choose the same version of Xcode that runs on our computer to prevent versioning conflicts.

AppCenter will choose automatically the package.json and the expected scheme. As you can see, we could add build scripts, but at this point we won’t do that.

We want to build this branch on every push and to automatically increment the build number.

In order to test this app on real devices we have to create a Development Provisioning Profile and a .p12 Certificate.

We upload the generated keystore file together with placing the Key alias and the passwords into the build configuration.

Similar to iOS, we want to test the build on a real device before distributing it.

Last steps of the configuration looks like this:

To see the magic, we click on "Save & Build".

If everything is setup correctly and the code passes all tests, the build will succeed:

Harvest

Once the build was successfully done, tested and distributed, the collaborators should be notified via email. The process of installing the app is straightforward.

iOS related: take note that if you created a Development Provisioning Profile, the collaborators’ devices must be added to the Provisioning Profile. Otherwise they won’t be able to install the application.

Now that we have both builds successfully configured, we push a new version of the code into the master branch.

As you can see below, our builds are queued immediately:

Conclusion

Testflight or HockeyApp combined with Fastlane do save a lot of time but if you need continuous build, test, release, distribution and app monitoring, AppCenter is what you want. This is definitely the future of Continuous Deployment for mobile applications.