# Replit Agent to Google Play Closed Testing Playbook: Exporting AABs, Secrets & 12 Testers

> Turn a Replit Agent full-stack web or Expo prototype into a policy-compliant Android App Bundle (`.aab`), decouple ephemeral `.replit.app` dev URLs, secure server secrets, and pass 14-day closed testing.

- **Canonical URL**: https://gootester.com/frameworks/replit-agent-android
- **Config File**: capacitor.config.ts & android/app/build.gradle
- **Build Command**: `npm run build && npx cap sync android && cd android && ./gradlew bundleRelease`

```typescript
import type { CapacitorConfig } from "@capacitor/cli";

const config: CapacitorConfig = {
  appId: "com.example.replitapp",
  appName: "Example Replit App",
  webDir: "dist/public",
  // Bundle static Vite/React assets locally inside the AAB (never point server.url at .replit.dev!)
  android: {
    allowMixedContent: false,
    captureInput: true,
    webContentsDebuggingEnabled: false
  },
  plugins: {
    StatusBar: {
      overlaysWebView: true
    }
  }
};

export default config;
```

## Critical Play Console Gotchas
1. **Pointing Capacitor `server.url` at a sleeping `.replit.dev` workspace URL**: Leaving `server.url` pointed at your live Replit workspace causes a blank white Chromium WebView error screen whenever your workspace container sleeps — triggering an instant Google Play 'Broken Functionality' rejection.
2. **Exposing Replit Secrets inside `VITE_*` client environment variables**: Any variable prefixed with `VITE_` or `EXPO_PUBLIC_` is baked directly into static JavaScript inside `assets/public/` where `jadx` or `unzip` reveals it in seconds. Keep OpenAI, Gemini, and Postgres credentials strictly inside your Express/Fastify backend deployment.
3. **Express session cookies failing across Android Capacitor `https://localhost` origin**: Replit Agent full-stack templates default to `express-session` cookies on the same web origin. Inside Capacitor Android (`https://localhost`), cross-origin API calls drop cookies unless `SameSite=None; Secure` + explicit CORS allowlists or Bearer token auth are configured.
4. **Missing Android 15/16 edge-to-edge safe-area padding on bottom navigation bars**: Web CSS built in Replit's desktop preview pane ignores `env(safe-area-inset-bottom)`, causing Android gesture bars on API 35+ phones to overlap primary submit buttons during Closed Testing.

## Decoupling Replit Full-Stack Monorepos into Local Assets + Always-On API

Replit Agent excels at scaffolding a unified React + Vite + Express + Drizzle/PostgreSQL monorepo in minutes. However, wrapping that monorepo naively as a remote URL bookmark fails Google Play's **Minimum Functionality** and **Broken Functionality** policies the moment network connectivity flickers or container cold-starts exceed timeout budgets.
The durable production architecture splits deployment cleanly in two: compile your `client/` Vite build into static `dist/public` assets bundled *inside* your Capacitor `.aab` (so the app shell, navigation, and offline retry UI render instantaneously with zero network dependency), while deploying your `server/` API onto an Reserved VM / Autoscale HTTPS custom domain (`https://api.example.com`) with proper CORS and TLS.
Before uploading `versionCode 1` to Play Console, verify that `applicationId` in `android/app/build.gradle` uses your permanent domain namespace (`com.example.replitapp`), set `targetSdkVersion = 35` (or `36`), sign with a backed-up upload keystore, and add `testers@gootester.com` to your Closed Testing Google Group.

## Authentication, Session Cookies, and Reviewer Demo Accounts

If your Replit Agent project uses Replit Auth, Passport.js session cookies, or OAuth redirects, test authentication inside a real Play-signed Android build before starting Day 1 of closed testing. Browser popups that try to redirect back to `https://*.replit.app/api/callback` strand Android users inside Chrome Custom Tabs unless wired to verified Android App Links (`/.well-known/assetlinks.json` signed with your Play App Signing SHA-256).
Equally critical, provision a non-expiring static email/password demo login (`support@example.com`) seeded with realistic sample rows and submit those exact instructions under `Play Console -> App content -> App access` — plus publish both `/privacy` and `/delete-account` HTTPS pages so Data Safety passes on the first review.

## Validating Vibe-Coded Layouts Across Real ARM64 Phones Over 14 Days

Desktop browser previews hide mobile viewport keyboard squishing, touch-target crowding, and WebView memory spikes. Remember that GOOtester's service clock starts only after your `testers@gootester.com` Closed Testing track setup is verified.
During your 14-to-24-day window ($6 Basic for 12 human testers, $12 Standard for 15 testers + 2 buffer days + separate ARM64 ADB QA, or $20 Premium for 25 testers + 3 buffer days + separate ARM64 ADB QA), use real human tester observations alongside isolated physical-device `dumpsys meminfo` / `gfxinfo` runs to ship `versionCode 2` and `versionCode 3` with tangible UX polish.
