Skip to content

Instantly share code, notes, and snippets.

@virtualprodigy
Created November 26, 2018 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save virtualprodigy/c8a25f47a34122e5a0430972e3503de9 to your computer and use it in GitHub Desktop.
Save virtualprodigy/c8a25f47a34122e5a0430972e3503de9 to your computer and use it in GitHub Desktop.
A simple shell script that you can use to create two AppCenter.ms CodePush projects. One for Android and one for iOS
#A script from VirtualProdigy that creates codepush applications for Android and iOS
#remember to give the script run permissions by running $chmod u+x <path to script>
# you can also run $appcenter profile list
# use the username as the ownername
echo "Fetching login details...enter the username for the ownername"
appcenter profile list
#set owner name. See offical docs https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cordova#api-reference
echo "Enter the ownername, followed by [ENTER]:"
read OWNER_NAME
#set application display name (will append andriod and ios to name when creating projects)
echo "Enter a display name for your application, followed by [ENTER]:"
echo "An Android and iOS project will be created. [<app-name>-ios , <app-name>-android]"
read APPLICATION_NAME
#Set project type, ie Cordova
echo "Enter the project type for your applications, followed by [ENTER]:"
read APPLICATION_TYPE
#Create platform applications
appcenter apps create -d $APPLICATION_NAME'-android' -p $APPLICATION_TYPE -o Android
appcenter apps create -d $APPLICATION_NAME'-ios' -p $APPLICATION_TYPE -o iOS
#Creating deployment stages
#iOS
appcenter codepush deployment add -a $OWNER_NAME/$APPLICATION_NAME-ios Staging
appcenter codepush deployment add -a $OWNER_NAME/$APPLICATION_NAME-ios Production
#Android
appcenter codepush deployment add -a $OWNER_NAME/$APPLICATION_NAME-android Staging
appcenter codepush deployment add -a $OWNER_NAME/$APPLICATION_NAME-android Production
#Display Deployment Keys
#iOS
echo "iOS Deployment Keys"
appcenter codepush deployment list --app $OWNER_NAME/$APPLICATION_NAME-ios
#Android
echo "Android Deployment Keys"
appcenter codepush deployment list --app $OWNER_NAME/$APPLICATION_NAME-android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment