# SevenX Engine - Verificador de Setup Android
# Verifica se tudo está configurado corretamente
Write-Host ""
Write-Host "🔍 SevenX Engine - Verificador de Setup Android" -ForegroundColor Cyan
Write-Host "=================================================" -ForegroundColor Cyan
Write-Host ""
$allOk = $true
# Verificar Rust
Write-Host "1. Verificando Rust..." -ForegroundColor Yellow
if (Get-Command cargo -ErrorAction SilentlyContinue) {
$rustVersion = cargo --version
Write-Host " ✅ Rust instalado: $rustVersion" -ForegroundColor Green
} else {
Write-Host " ❌ Rust não encontrado!" -ForegroundColor Red
Write-Host " Instale de: https://rustup.rs" -ForegroundColor Yellow
$allOk = $false
}
# Verificar cargo-apk
Write-Host ""
Write-Host "2. Verificando cargo-apk..." -ForegroundColor Yellow
if (Get-Command cargo-apk -ErrorAction SilentlyContinue) {
Write-Host " ✅ cargo-apk instalado" -ForegroundColor Green
} else {
Write-Host " ❌ cargo-apk não encontrado!" -ForegroundColor Red
Write-Host " Execute: cargo install cargo-apk" -ForegroundColor Yellow
$allOk = $false
}
# Verificar target Android
Write-Host ""
Write-Host "3. Verificando target Android..." -ForegroundColor Yellow
$targets = rustup target list --installed
if ($targets -match "aarch64-linux-android") {
Write-Host " ✅ Target aarch64-linux-android instalado" -ForegroundColor Green
} else {
Write-Host " ❌ Target Android não encontrado!" -ForegroundColor Red
Write-Host " Execute: rustup target add aarch64-linux-android" -ForegroundColor Yellow
$allOk = $false
}
# Verificar ANDROID_HOME
Write-Host ""
Write-Host "4. Verificando ANDROID_HOME..." -ForegroundColor Yellow
$androidHome = [System.Environment]::GetEnvironmentVariable('ANDROID_HOME', 'User')
if ($androidHome -and (Test-Path $androidHome)) {
Write-Host " ✅ ANDROID_HOME configurado: $androidHome" -ForegroundColor Green
} else {
Write-Host " ❌ ANDROID_HOME não configurado!" -ForegroundColor Red
Write-Host " Execute o script de configuração" -ForegroundColor Yellow
$allOk = $false
}
# Verificar ANDROID_NDK_HOME
Write-Host ""
Write-Host "5. Verificando ANDROID_NDK_HOME..." -ForegroundColor Yellow
$ndkHome = [System.Environment]::GetEnvironmentVariable('ANDROID_NDK_HOME', 'User')
if ($ndkHome -and (Test-Path $ndkHome)) {
Write-Host " ✅ ANDROID_NDK_HOME configurado: $ndkHome" -ForegroundColor Green
} else {
Write-Host " ⚠️ ANDROID_NDK_HOME não configurado" -ForegroundColor Yellow
# Tentar encontrar NDK automaticamente
if ($androidHome) {
$ndkPath = Join-Path $androidHome "ndk"
if (Test-Path $ndkPath) {
$ndkVersions = Get-ChildItem $ndkPath -Directory
if ($ndkVersions.Count -gt 0) {
$latestNdk = $ndkVersions | Sort-Object Name -Descending | Select-Object -First 1
Write-Host " 📍 NDK encontrado em: $($latestNdk.FullName)" -ForegroundColor Cyan
Write-Host " Configure com:" -ForegroundColor Yellow
Write-Host " [System.Environment]::SetEnvironmentVariable('ANDROID_NDK_HOME', '$($latestNdk.FullName)', 'User')" -ForegroundColor White
} else {
Write-Host " ❌ NDK não encontrado!" -ForegroundColor Red
Write-Host " Instale via Android Studio: Tools → SDK Manager → SDK Tools → NDK" -ForegroundColor Yellow
$allOk = $false
}
}
}
}
# Verificar ADB
Write-Host ""
Write-Host "6. Verificando ADB..." -ForegroundColor Yellow
if (Get-Command adb -ErrorAction SilentlyContinue) {
$adbVersion = adb version 2>&1 | Select-Object -First 1
Write-Host " ✅ ADB instalado: $adbVersion" -ForegroundColor Green
} else {
Write-Host " ❌ ADB não encontrado no PATH!" -ForegroundColor Red
Write-Host " Feche e abra o terminal, ou adicione ao PATH manualmente" -ForegroundColor Yellow
$allOk = $false
}
# Verificar dispositivo conectado
Write-Host ""
Write-Host "7. Verificando dispositivo Android..." -ForegroundColor Yellow
if (Get-Command adb -ErrorAction SilentlyContinue) {
$devicesOutput = adb devices 2>&1
$devices = $devicesOutput | Select-String "device$" | Where-Object { $_ -notmatch "List of devices" }
if ($devices.Count -gt 0) {
Write-Host " ✅ Dispositivo conectado:" -ForegroundColor Green
$devices | ForEach-Object { Write-Host " $_" -ForegroundColor Cyan }
} else {
Write-Host " ⚠️ Nenhum dispositivo conectado" -ForegroundColor Yellow
Write-Host " Conecte seu celular via USB e ative a Depuração USB" -ForegroundColor Yellow
}
} else {
Write-Host " ⏭️ Pulando (ADB não disponível)" -ForegroundColor Gray
}
# Verificar exemplos
Write-Host ""
Write-Host "8. Verificando exemplos..." -ForegroundColor Yellow
$examples = @("android_test.rs", "android_demo.rs", "mobile_shooter.rs", "android_advanced_demo.rs")
$examplesOk = $true
foreach ($example in $examples) {
if (Test-Path "examples/$example") {
Write-Host " ✅ $example" -ForegroundColor Green
} else {
Write-Host " ❌ $example não encontrado" -ForegroundColor Red
$examplesOk = $false
}
}
if (!$examplesOk) {
$allOk = $false
}
# Resumo
Write-Host ""
Write-Host "=================================================" -ForegroundColor Cyan
if ($allOk) {
Write-Host ""
Write-Host "🎉 TUDO PRONTO!" -ForegroundColor Green
Write-Host ""
Write-Host "Você pode compilar agora:" -ForegroundColor Cyan
Write-Host " .\build-android.ps1" -ForegroundColor White
Write-Host ""
} else {
Write-Host ""
Write-Host "⚠️ CONFIGURAÇÃO INCOMPLETA" -ForegroundColor Yellow
Write-Host ""
Write-Host "Siga as instruções acima para corrigir os problemas." -ForegroundColor Yellow
Write-Host ""
Write-Host "Guias disponíveis:" -ForegroundColor Cyan
Write-Host " - GUIA_RAPIDO_PARA_VOCE.md" -ForegroundColor White
Write-Host " - TESTAR_NO_CELULAR.md" -ForegroundColor White
Write-Host ""
}
Write-Host "=================================================" -ForegroundColor Cyan
Write-Host ""