كيفية نشر APK تلقائيًا إلى Firebase بنقرة واحدة (عربي)

دليل خطوة بخطوة لإعداد نشر APK تلقائيًا إلى Firebase باستخدام Bash وZsh وFish Script.

Tags:
  • #Flutter
  • #Firebase
  • #Automation
  • #Bash Script
  • #Zsh Script
  • #Fish Script
Learning Path: Not Found | Category: DevOps

Table of Contents

  1. مقدمة
  2. المتطلبات
  3. إعداد Firebase CLI
  4. نشر البرنامج النصي: Bash وZsh وFish
  5. تشغيل الوظيفة
  6. إضافة الإشعارات بعد النشر
  7. الخاتمة

1. مقدمة

Deploying APKs to Firebase manually can be time-consuming. To streamline this process, we can use automation scripts to deploy with a single command.

This guide will walk you through setting up Firebase CLI and creating a deployment function using Bash, Zsh, and Fish, along with adding notifications upon completion.


2. المتطلبات

Before starting, ensure you have:


3. إعداد Firebase CLI

  1. Log in to Firebase CLI:
    firebase login
  2. Get your Firebase project list:
    firebase projects:list
  3. Retrieve APP_ID from Firebase Console:
    • Open Firebase Console.
    • Select your project.
    • Go to Project settings.
    • In the General tab, find Your apps and copy the APP_ID for your Android app.

4. نشر البرنامج النصي: Bash وZsh وFish

Replace your-app-id with the APP_ID retrieved from Firebase Console.

function deployPPM() {
    APP_ID="your-app-id"
    flutter clean 
    flutter build apk --release &&     firebase appdistribution:distribute build/app/outputs/flutter-apk/app-release.apk     --app $APP_ID --release-notes "$1" --groups Tester1
}

For Fish Shell, use:

function deployPPM
    set APP_ID "your-app-id"
    flutter clean 
    flutter build apk --release &&     firebase appdistribution:distribute build/app/outputs/flutter-apk/app-release.apk     --app $APP_ID --release-notes $argv[1] --groups Tester1
end

5. تشغيل الوظيفة

To run the function, use:

deployPPM "Latest version release notes"

6. إضافة الإشعارات بعد النشر

For Xubuntu, add a notification:

function deployPPM() {
    APP_ID="your-app-id"
    flutter clean 
    flutter build apk --release &&     firebase appdistribution:distribute build/app/outputs/flutter-apk/app-release.apk     --app $APP_ID --release-notes "$1" --groups Tester1 &&     notify-send "Deployment Complete" "APK successfully uploaded to Firebase."
}

For macOS, replace notify-send with osascript:

osascript -e 'display notification "APK successfully uploaded to Firebase." with title "Deployment Complete"'

7. الخاتمة

Using Bash, Zsh, or Fish functions, you can automate APK deployment to Firebase App Distribution with a single command. This saves time and reduces manual errors.

To deploy, simply run:

deployPPM "New feature updates and bug fixes."

You’ll receive a notification once the deployment is complete. 🚀

Logo Adib

© 2025 Adib

GitHub