37 lines
1.4 KiB
PowerShell
37 lines
1.4 KiB
PowerShell
# 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"
|