#!/bin/bash # =============================== # Flutter APK & AAB Build Script # =============================== # Exit immediately if a command exits with a non-zero status set -e # Colors for pretty output GREEN='\033[0;32m' CYAN='\033[0;36m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # App info APP_NAME="Marco" BUILD_DIR="build/app/outputs" echo -e "${CYAN}๐Ÿš€ Starting Flutter build script for $APP_NAME...${NC}" # Step 1: Clean previous builds echo -e "${YELLOW}๐Ÿงน Cleaning previous builds...${NC}" flutter clean # Step 2: Get dependencies echo -e "${YELLOW}๐Ÿ“ฆ Fetching dependencies...${NC}" flutter pub get # ============================== # Step 3: Build AAB (Commented) # ============================== echo -e "${CYAN}๐Ÿ— Building AAB file...${NC}" flutter build appbundle --release # Step 4: Build APK echo -e "${CYAN}๐Ÿ— Building APK file...${NC}" flutter build apk --release # Step 5: Show output paths AAB_PATH="$BUILD_DIR/bundle/release/app-release.aab" APK_PATH="$BUILD_DIR/apk/release/app-release.apk" echo -e "${GREEN}โœ… Build completed successfully!${NC}" echo -e "${YELLOW}๐Ÿ“ AAB file: ${CYAN}$AAB_PATH${NC}" echo -e "${YELLOW}๐Ÿ“ APK file: ${CYAN}$APK_PATH${NC}" # Optional: open the folder (Mac/Linux) if command -v xdg-open &> /dev/null then xdg-open "$BUILD_DIR" elif command -v open &> /dev/null then open "$BUILD_DIR" fi