MS App Center Integration
Below are details for uploading your app from the Microsoft App Center to your internal storage inside Mobitru.
Prerequisites
- An account in Microsoft App Center.
- Repository with project source code.
- Prepared Mobitru Access key.
Upload the app using post build script
The MS App Center allows you to perform actions after the build by preparing post build script and placing it in the root folder of your project:
- Go to your project root directory and create an appcenter-post-build.sh file in IDE or any editor.
- In case of cross-platform app (frameworks like Flutter or React Native), add
APPLICATION_NAME
andBUILD_NAME
env variables to the script (in case of single iOS or Android project, you can skip adding of names change ):#!/usr/bin/env bash #default values APPLICATION_NAME="mobitru.app.name" BUILD_NAME="mobitru.build.name" #change names based on project type if [[ "$APPCENTER_XCODE_PROJECT" ]]; then APPLICATION_NAME="iOS.mobitru.sample.ipa" BUILD_NAME="MobitruSampleIosApp.ipa" else APPLICATION_NAME="Android.mobitru.sample.apk" BUILD_NAME="MobitruSampleAndroidApp.apk" fi
- Complete example with uploading part:
#!/usr/bin/env bash #default values APPLICATION_NAME="mobitru.app.name" BUILD_NAME="mobitru.build.name" #change names based on project type if [[ "$APPCENTER_XCODE_PROJECT" ]]; then APPLICATION_NAME="iOS.mobitru.sample.ipa" BUILD_NAME="MobitruSampleIosApp.ipa" else APPLICATION_NAME="Android.mobitru.sample.apk" BUILD_NAME="MobitruSampleAndroidApp.apk" fi echo "**************** PUBLISH APPLICATION TO MOBITRU ******************" echo "APPLICATION NAME => $APPLICATION_NAME" echo "BUILD NAME => $BUILD_NAME" curl --location --request POST 'https://app.mobitru.com/billing/unit/$MOBITRU_BILLING_UNIT/automation/api/v1/spaces/artifacts' \ --header 'x-File-Name: $APPLICATION_NAME' \ --header 'X-Content-Type: application/zip' \ --header 'Authorization: Bearer $MOBITRU_ACCESS_KEY' \ --form 'file=@"$APPCENTER_OUTPUT_DIRECTORY/$BUILD_NAME"' \ --form 'checksum="None"'