initial commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
# Génère les dossiers plateforme Android + iOS uniquement (sans web).
|
||||
# À exécuter une fois après clone, depuis le dossier mobile/.
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if (-not (Get-Command flutter -ErrorAction SilentlyContinue)) {
|
||||
Write-Error "Flutter n'est pas dans le PATH. Installez-le : https://docs.flutter.dev/get-started/install/windows"
|
||||
}
|
||||
|
||||
Write-Host "Génération des plateformes Android et iOS (sans web)..." -ForegroundColor Cyan
|
||||
|
||||
flutter create . `
|
||||
--org fr.laverie `
|
||||
--project-name laverie_mobile `
|
||||
--platforms android,ios
|
||||
|
||||
flutter pub get
|
||||
|
||||
# Autoriser HTTP clair en debug (API locale sans HTTPS)
|
||||
$debugManifest = "android/app/src/debug/AndroidManifest.xml"
|
||||
if (Test-Path $debugManifest) {
|
||||
@"
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- Dev local : API Laravel sur http://10.0.2.2:8000 -->
|
||||
<application android:usesCleartextTraffic="true" />
|
||||
</manifest>
|
||||
"@ | Set-Content -Path $debugManifest -Encoding UTF8
|
||||
Write-Host "Android debug : cleartext HTTP activé ($debugManifest)" -ForegroundColor DarkGray
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Terminé. Lancez sur Android :" -ForegroundColor Green
|
||||
Write-Host " flutter run -d android"
|
||||
Write-Host ""
|
||||
Write-Host "Sur appareil physique, précisez l'IP du backend :" -ForegroundColor Yellow
|
||||
Write-Host " flutter run -d android --dart-define=API_BASE_URL=http://192.168.x.x:8000/api/v1"
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
# Génère les dossiers plateforme Android + iOS uniquement (sans web).
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
if ! command -v flutter &>/dev/null; then
|
||||
echo "Flutter introuvable. https://docs.flutter.dev/get-started/install"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Génération des plateformes Android et iOS (sans web)..."
|
||||
|
||||
flutter create . \
|
||||
--org fr.laverie \
|
||||
--project-name laverie_mobile \
|
||||
--platforms android,ios
|
||||
|
||||
flutter pub get
|
||||
|
||||
# Autoriser HTTP clair en debug (API locale)
|
||||
DEBUG_MANIFEST="android/app/src/debug/AndroidManifest.xml"
|
||||
if [ -f "$DEBUG_MANIFEST" ]; then
|
||||
cat > "$DEBUG_MANIFEST" <<'EOF'
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- Dev local : API Laravel sur http://10.0.2.2:8000 (Android) -->
|
||||
<application android:usesCleartextTraffic="true" />
|
||||
</manifest>
|
||||
EOF
|
||||
echo "Android debug : cleartext HTTP activé"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Android : flutter run -d android"
|
||||
echo "iOS (macOS) : flutter run -d ios"
|
||||
Reference in New Issue
Block a user