A mobile Truth or Dare game for iOS and Android application built using Flutter with CI/CD running on Codemagic.

Overview

ToD Game Codemagic build status

A mobile Truth or Dare game for iOS and Android application built using Flutter with CI/CD running on Codemagic.

Demo

Get it on Google Play Get it on the App Store

Quick Start

Prerequisites

  • Install Ruby Version Manager – not required, but recommended (see below for details)
  • Install flutter and dependencies, including:
    • Xcode
    • Cocoapods (when you chose to use RVM, then make sure to install Cocoapods again for the current ruby environment – i.e. Ruby 2.4.1)
  • Install dart
    brew tap dart-lang/dart
    brew install dart

RVM & Ruby

macOS

You'll need a ruby environment. It's recommended to use RVM.

  1. On a Mac you'll need to install GPG first, ex: https://gpgtools.org or better use ``
  2. Then install RVM by running:
gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \
curl -sSL https://get.rvm.io | bash -s stable

if you're getting a "no route to host" error instead run this:

gpg --keyserver hkp://51.38.91.189 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable
  1. If you just installed RVM, then install Ruby as well:
rvm install 2.4.1

The ruby version is specificed in .ruby-version file.

After you have Ruby installed using RVM, you can run:

bundle install
Windows

TODO: add windows instructions (contributions welcome)

Automated Build process

Environment setup

You need to add the following environmental variables in your .zshrc or .bash_profile (or similar for your shell):

export TOD_APPLE_ID=[your apple id]
export TOD_APP_SPECIFIC_PASSWORD=[your app specific password for CI/CD]
export [email protected]:your-org/your-repository.git
export TOD_MATCH_PASSPHRASE=[the password to encrypt/decrypt your match repository]

Remember to run this after setting these variables for your current terminal instance (needed only once during setup):

source ~/.zshrc

Setup iOS builds

Create the app in AppStore Connect

Firstly create you app and bundle ID at https://developer.apple.com and use the values later on.

Set your Apple Developer values

Replace the com.itcraftship.truth-or-dare bundle ID and Apple Team ID in all relevant places:

  • fastlane/Matchfile
  • fastlane/Fastfile
  • fastlane/Appfile
  • ios/Runner.xcodeproj/project.pbxproj

Change your Apple Team ID (team_id) in fastlane/Appfile.

Create keychain

On your macOS device run:

bundle exec fastlane setup_keychain

This will create a new keychain to use for code signing. The password used for the keychain is secretPass. You don't need to worry about making it secure as it will be only on your local machine.

Code Signing

First you need to create an SSH key for accessing your git repository with certificates for Fastlane Match to be able to clone it during the Fastlane build action. To encrypt the certificates repository you should use the value stored in TOD_MATCH_PASSPHRASE environment variable.

To create the certificates & provisioning profiles in your Apple Developer Account you'll need to run these 3 commands:

MATCH_PASSWORD=$TOD_MATCH_PASSPHRASE bundle exec fastlane match adhoc
MATCH_PASSWORD=$TOD_MATCH_PASSPHRASE bundle exec fastlane match development
MATCH_PASSWORD=$TOD_MATCH_PASSPHRASE bundle exec fastlane match appstore

When prompted for passwords/apple ID use the values that you configured in the environment above.

Make an iOS release to TestFlight/App Store

Now you should be all set to deliver your app to TestFlight

sh ci/build_ios_qa.sh

Setup Android builds

Create the app in Google Play Console

Visit the Google Play Console and create your new application. Make sure you opt-in for Google CodeSigning in Setup > App signing submenu item.

Generate a key and keystore

  1. Use the following command to initiate keytore and certificate generation:
    keytool -genkey -v -keystore itc-release.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias itc
  2. Backup your itc-release.keystore file and store passwords safely. If you loose this, then there's a painful process that includes contacting Google's support (see: Create a new upload key).

You can call the keystore whatever you like instead of itc-release.keystore, but you'll have to use that new name across all other placess, .i.e.:

  • android/key.properties
  • codemagic.yaml

Create a key.properties file

Create a android/key.properties file with the keystore file name password set in the previous step:

storePassword=thePasswordFromBefore
keyPassword=thePasswordFromBefore
keyAlias=itc
storeFile=../../itc-release.keystore

Generate a google_play.json for upload

As Google Play account owner follow these instructions to generate the JSON key for API upload to Google Play: https://developers.google.com/android-publisher/getting_started

Add this google_play.json file to the root of your project. This will allow uploading to the Google Play store.

Make a release to Google Play

Run:

sh sh ci/build_android_qa.sh

Setup the builds with Codemagic

Please take a look at the detailed tutorial to learn how to fork this app and set it up for release in Apple AppStore and Google Play using Fastlane and Codemagic.

License

Released under MIT License. See LICENSE for more info.

Comments
  • Feature/codemagic tutorial

    Feature/codemagic tutorial

    • Edited and tested the tutorial instructions
    • Updated Fastlane and added missing files to the repo
    • Updated email used for notifications by Codemagic
    • Updated flutter and locked XCode version in Codemagic
    • Moved all images into the repository

    Closes #8

    opened by maksymilian-majer 1
  • Write the Codemagic tutorial

    Write the Codemagic tutorial

    The purpose of the tutorial is to explain all the steps needed for someone to build this repository in their own Apple Developer account and Google Play console under their own bundle/app identifier. It starts by cloning the repository and then going through all the steps necessary to publish using Fastlane from the local computer and then how to set it up in Codemagic.

    opened by maksymilian-majer 0
  • Publish the tutorial in Flutter Community

    Publish the tutorial in Flutter Community

    To get the most out of it for both of us, I would suggest you publish it on Medium first. Flutter Community publication is definitely the best for this. After that, we would like to publish it on our website too

    opened by maksymilian-majer 1
  • Create a handy script to update Bundle ID and App ID

    Create a handy script to update Bundle ID and App ID

    Once the tutorial has been implemented, we should replace the manual step to replace the app identifiers with a simple script that we can run like this:

    pub run rename_app com.mydomain.myapp
    

    This can simplify the step of renaming.

    opened by maksymilian-majer 0
  • Create a functional test example setup

    Create a functional test example setup

    • [ ] Add a test – ex. navigating to the game type choice from the home screen
    • [ ] Include the test in Fastlane lane for approving PRs
    • [ ] Add goldens
    opened by maksymilian-majer 0
  • Add to lists of open source apps

    Add to lists of open source apps

    opened by maksymilian-majer 1
Owner
ITCraftship
ITCraftship
A Flutter 2D RPG Game Engine On Web & Android & IOS.

DevilF Engine A Flutter 2D RPG Game Engine On Web & Android & IOS. The Devilf Engine Is A Open Source 2D Game Engine. The Engine Is Development Using

zhaoqipeng 15 Oct 20, 2022
Pet Shop is an e-commerce application for Android built with Flutter (iOS to come soon).

Check out my latest project >> MOVING PICTURES Pet Shop is an e-commerce application for Android built with Flutter (iOS to come soon). The goal is to

Nifemi 209 Dec 28, 2022
A Flutter plugin for handling Connectivity and REAL Connection state in the mobile, web and desktop platforms. Supports iOS, Android, Web, Windows, Linux and macOS.

cross_connectivity A Flutter plugin for handling Connectivity and REAL Connection state in the mobile, web and desktop platforms. Supports iOS, Androi

MarchDev Toolkit 29 Nov 15, 2022
Number trivia Android and ios application using flutter clean architecture

demo_project A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Koushik J A 2 Jun 9, 2022
Cross platform application for iOS and Android using Google's SDK Flutter.

scout Cross platform application for iOS and Android using Google's SDK Flutter. Launch screen for the application. The menu for selecting cookies. Cu

null 0 Nov 9, 2021
Relive is a cross-platform application that can be used both in Android/IOS and it is made using Flutter

?? Introduction Relive is a cross-platform application that can be used both in Android/IOS and it is made using Flutter. It aims to solve the mental

Akshat Tripathi 14 Nov 4, 2022
KeepReading - a Mobile (Android/IOS) Cross-Platform App wrapper for the Keep Talking and Nobody Explodes manual

KeepReading is a Mobile (Android/IOS) Cross-Platform App wrapper for the Keep Talking and Nobody Explodes manual. It helps you to jump directly to a specific section of the manual with just a tap ?? !

Nicolò Vescera 2 May 16, 2022
A mobile image uploader in which you can upload image to your personal gallery from either your camera or mobile gallery and it can detect your current geographic location and address using firebase firestore and storage.

Image Uploader In Flutter About It is an Image Uploader gallery which tracks your address from which you're uploading using Flutter and Image picker.

Prahen parija 6 Dec 20, 2022
Note app is open-source notes app for Android & ios. It is built with Dart on top of Google's Flutter Framework.

Note App ✍?? Note App & SqfLite &GetX [MVC pattern] ????‍?? Note app is open-source notes app for Android & ios. It is built with Dart on top of Googl

null 25 Nov 29, 2022
Tesla car app using Flutter that works both android and iOS. Users can unlock any door, check battery status also control the air cooler temperature and check the psi of the tires.

Tesla App Tesla car app using Flutter that works both android and iOS. Users can unlock any door, check battery status also control the air cooler tem

null 12 Dec 18, 2022
Flutter-mobile - Android app for Invoice Ninja built with Flutter

Invoice Ninja Client app for Invoice Ninja. Desktop Apps Mobile Apps Setting up the app Initialize the config file cp lib/.env.dart.example lib/.env.d

Invoice Ninja 1.3k Dec 30, 2022
Flutter application that implements socket.io in Node.js Works in - Android, iOS and Web

Quick Chat - Flutter Flutter application that implements socket.io in Node.js Works in - Android, iOS and Web This repo only contains Flutter (fronten

Aayush Nikkon Subedi 22 Dec 23, 2022
Task List application developed in Dart language with SDK Flutter for Android, iOS and Web

Task List application developed in Dart language with SDK (Software Development Kit) Flutter for Android, iOS and Web.

João Bruno 2 Jun 2, 2022
Cloth Shop it's an example using Flutter for Android and iOS.

Cloth Shop - Flutter Cloth Shop it's an example using Flutter for Android and iOS. About This repository serves the source code for the Ecommers sampl

null 24 Oct 4, 2022
Ready for Building Production-Ready Healthcare/ Doctor Consult Android and iOS app UI using Flutter.

Production-Ready Doctor Consultant App - Flutter UI Packages we are using: flutter_svg: link In this full series, we will show you how to Building Pro

Anurag Jain 26 Nov 28, 2022
An android app built using flutter that displays and forecast the specific city Weather and Climate for dynamic time event by collecting the data from API that is provided for free by OPENWEATHER site.

clima_weather_reporter A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get y

dev_allauddin 3 Feb 3, 2022
A self-hosted controller for mobile and macOS built using the Flutter framework.

LunaSea LunaSea is a fully featured, open source self-hosted controller! Focused on giving you a seamless experience between all of your self-hosted m

Comet.Tools 844 Jan 2, 2023
An Android/ios app which predicts patient's journey time in Hospital environment using ML

pqt_fourth A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if th

Amaan Sharif Nirban 1 Dec 26, 2021