Built for Phaser

Ship your Phaser game as a native Android app

Convert your exported Phaser build into a signed APK or AAB. No Android Studio and no native code. Built by a Phaser game developer. iOS support is coming soon.

  • No Android Studio
  • Signed APK & AAB
  • Your source stays yours
The Phaser platformer game running as a native Android app

01 How it works

From exported build to store-ready app

Upload the folder Phaser exports, choose the name, icon and orientation, then download a signed build.

  1. 1

    Export your game

    Zip your Phaser dist folder: HTML, JavaScript and assets.

  2. 2

    Configure the app

    Set the name, icon, package ID and orientation lock.

  3. 3

    Download and publish

    Get a signed APK to test on a phone, or an AAB for Google Play.

html2app build release · aab

$ upload my-phaser-game.zip

Unzipping project

Detecting Phaser engine

Wrapping canvas in native shell

Signing app-release.aab

Build finished

02 Mobile optimization

Optimize your Phaser game for phones

Phones differ from desktops in screen shape, pixel density, touch input and background behaviour. These eight areas cover most of the work. The examples use Phaser 4.2, the latest 4.x release.

01

Viewport and safe areas

Without viewport-fit=cover, iPhones and notched Android phones keep the page inside the safe area, so the canvas never reaches the edges. With it, the canvas can use the full screen. Keep on-screen controls inside env(safe-area-inset-*) so they clear the notch and the rounded corners.

Use 100dvh instead of 100vh. Dynamic viewport units follow the address bar as it shows and hides, so the game does not jump.

index.html
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
style.css
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

#game {
  height: 100dvh;
}

canvas {
  display: block;
  touch-action: none; /* no browser panning or pinch-zoom over the game */
}
02

Choose a scale mode

The Scale Manager sizes the canvas to its parent. FIT keeps the whole game visible and adds bars where the aspect ratio differs. ENVELOP fills the screen and crops the edges. RESIZE gives you the full screen size, and you lay out the HUD yourself.

Use FIT for fixed-layout games. Use RESIZE when the HUD has to adapt to each screen.

game.js
const game = new Phaser.Game({
  type: Phaser.AUTO,
  parent: 'game',
  width: 390,
  height: 844,
  scale: {
    mode: Phaser.Scale.FIT,
    autoCenter: Phaser.Scale.CENTER_BOTH,
  },
});
03

Handle resize and rotation

A phone fires a resize when it rotates or when the address bar changes. Listen to the Scale Manager's RESIZE event instead of window's resize event. Phaser updates the canvas first, so the gameSize you receive is already the new size.

Remove the listener on SHUTDOWN, so a restarted scene does not keep the old callback. If your own code moves or hides the canvas, call this.scale.refresh() so Phaser recalculates its bounds.

Level.js
class Level extends Phaser.Scene {
  create() {
    this.scoreText = this.add.text(16, 16, 'Score 0', { fontSize: '28px' });

    // Touch target; the pause icon is drawn on the same spot
    this.pauseButton = this.add.zone(0, 0, 48, 48).setInteractive();
    this.pauseButton.on('pointerdown', () => this.scene.pause());

    this.layoutHud(this.scale.gameSize);
    this.scale.on(Phaser.Scale.Events.RESIZE, this.layoutHud, this);

    this.events.once(Phaser.Scenes.Events.SHUTDOWN, () => {
      this.scale.off(Phaser.Scale.Events.RESIZE, this.layoutHud, this);
    });
  }

  layoutHud(gameSize) {
    this.pauseButton.setPosition(gameSize.width - 36, 36);
  }
}
04

Match the pixel density

Phaser sizes the canvas from width and height. It does not read devicePixelRatio for you. On a 3x phone, a 390 px canvas is stretched three times, and text looks soft.

Set the base size to the CSS size multiplied by the device pixel ratio, capped at 2. FIT still shows the canvas at CSS size. On a 3x phone this draws about 44% of the physical pixels, which keeps the frame rate reasonable. We tested scale.zoom in FIT mode, and it did not change the canvas size, so use a scaled base size instead.

Game units are now DPR times larger. Place HUD with this.scale.gameSize, and multiply hand-set sizes by DPR. Pixel art games should set pixelArt: true, so scaled sprites stay sharp.

game.js
const DPR = Math.min(window.devicePixelRatio || 1, 2);

const game = new Phaser.Game({
  type: Phaser.AUTO,
  parent: 'game',
  width: 390 * DPR,
  height: 844 * DPR,
  scale: {
    mode: Phaser.Scale.FIT,
    autoCenter: Phaser.Scale.CENTER_BOTH,
  },
  pixelArt: false, // true for pixel art
});
05

Make touch input reliable

Phaser merges mouse and touch into one pointer API, so pointerdown fires on a tap just as it does on a click. For multi-touch, raise input.activePointers. Its default is 1, so set it to the number of fingers your controls need.

Use pointerdown for buttons that should react at once. Use pointerup when the action should count only if the finger lifts over the button. Keep touch targets at least 44 CSS px square, and multiply them by DPR when you use a scaled base size.

game.js
const game = new Phaser.Game({
  input: { activePointers: 3 }, // track up to three fingers
  disableContextMenu: true,     // no long-press menu on Android
});

// Inside a scene: a 48 x 48 touch target for the pause button
const pause = this.add.zone(x, y, 48, 48).setInteractive();
pause.on('pointerdown', () => this.scene.pause());
06

Unlock audio and handle the background

Phones block audio until the player touches the screen. Check this.sound.locked, and wait for the UNLOCKED event before you start the music.

When the app goes to the background, Phaser fires HIDDEN. Pause the game state there, so a player who returns is not left inside a running match.

Menu.js
class Menu extends Phaser.Scene {
  create() {
    const playTheme = () => {
      this.sound.play('theme', { loop: true });
    };

    if (this.sound.locked) {
      this.sound.once(Phaser.Sound.Events.UNLOCKED, playTheme);
    } else {
      playTheme();
    }

    const onHidden = () => this.scene.pause();
    this.game.events.on(Phaser.Core.Events.HIDDEN, onHidden);
    this.events.once(Phaser.Scenes.Events.SHUTDOWN, () => {
      this.game.events.off(Phaser.Core.Events.HIDDEN, onHidden);
    });
  }
}
07

Keep the frame rate steady

Phones have less GPU memory and fill rate than laptops. Pack sprites into texture atlases, so one draw call covers many objects. autoMobileTextures limits WebGL to one texture per batch on iOS and Android. skipUnreadyShaders stops the frame from stalling while shaders compile, but objects whose shader is not ready are skipped. Warm them up during loading.

Measure on a mid-range phone, not on a flagship or a desktop browser.

game.js
const game = new Phaser.Game({
  autoMobileTextures: true,  // one texture per batch on iOS and Android
  skipUnreadyShaders: true,  // skip objects whose shader is still compiling
});
08

Test on a real phone

Browser device emulation does not show real GPU, touch or audio behaviour. Five-server, the dev server by Yannick (@yandeu), can serve your build over your Wi-Fi. With --host=0.0.0.0, it prints a Network URL. Open that URL on your phone.

Use 0.0.0.0 only on a network you trust. It makes your files reachable from every device on that network.

terminal
npm install -g five-server
five-server --root=dist --host=0.0.0.0 --no-browser
fiveserver.config.js
module.exports = {
  remoteLogs: 'magenta', // show the phone's console in this terminal
};

03 Why Phaser devs choose it

Built around the problems Phaser games hit on mobile

The things that usually take the most time when you take a Phaser game to mobile, handled for you.

True full-screen canvas

Your game runs in a Flutter WebView with hybrid composition enabled. It fills the whole screen, with no browser bar and no pinch-zoom.

Native touch and input

Low-latency touch and gesture handling, so controls feel responsive.

Offline and embedded

Your whole game ships inside the app. It launches instantly and works without a network.

AdMob for games

Monetize with banner, interstitial and rewarded ads through a one-click native plugin.

Lock orientation

Set portrait or landscape, so the game launches the way you designed it.

One-click plugins

Vibration, storage, device info and more. Native features without native code.

04 Native features, plain JavaScript

Make the phone buzz when the player gets hit

html2app ships a typed js-bridge, so your Phaser game can call native features directly. Here the phone vibrates when the player collides with an enemy. It is one line, needs no native code, and does nothing in the browser.

  • Drop it straight into your collision handler
  • Control duration and amplitude, or use a custom pattern
  • Fully typed, with autocomplete in your editor
Read the Vibration API docs
GameScene.js
import { Vibration } from '@yandeu/js-bridge/lib/plugins/vibration.js';

export default class GameScene extends Phaser.Scene {
  create() {
    // buzz the phone whenever the player hits an enemy
    this.physics.add.overlap(this.player, this.enemies, this.onPlayerHit, undefined, this);
  }

  onPlayerHit(player, enemy) {
    player.takeDamage(10);

    // 200 ms at full strength, ignored on the web
    Vibration.vibrate(200, 255);
  }
}
Yannick Deubel, Phaser game developer and creator of enable3d Yannick (@yandeu) Phaser game developer · creator of enable3d

05 Built by an expert

Made by a Phaser game developer who ships Phaser games

I have maintained open-source projects and worked on Phaser for years. I built html2app.dev to solve the problems I hit shipping my own Phaser games, such as orientation lock, hiding the status bar, and a true full-screen canvas. If you build in 3D, it runs my enable3d library just fine too.

06 Pricing

Ship unlimited games for $36 a year

One simple plan: build and publish as many Phaser games as you want to Google Play. There is a free tier to get started, and no credit card is needed.

Need more? Compare every plan on the main pricing page.

$5/month Billed monthly, with a $36/year option
  • Unlimited apps and games, no per-app fees
  • Signed APK and AAB, ready for Google Play
  • Cloud builds, no Android Studio
  • Your signing key and app ID, no lock-in

07 FAQ

Questions Phaser devs ask

Still have questions or hit a snag? Join the community on GitHub. Ask anything, share what you are building, and get help.

Join the discussion
Which Phaser versions are supported?
Any of them. html2app runs your exported game, so Phaser 3, Phaser 4 or an older version works the same. The mobile guide examples use Phaser 4.2.
Do I have to change my game for mobile?
Usually a few settings. The mobile guide covers the viewport, scale mode, pixel density, touch input and audio unlock.
Do I keep ownership of my source code?
Yes. Your code stays yours. You bring your own signing key and app ID, so you can move to another toolchain at any time and keep updating the same store listing.
Will touch input work properly?
Yes. Your game runs in the platform's WebView through Flutter, with hybrid composition enabled. Touch and pointer events behave as they do in a mobile browser, and Phaser's input system works unchanged.
APK or AAB, what do I get?
Both. Download a signed APK for direct installs and testing, or an AAB bundle ready to publish to Google Play.
Do I need Android Studio?
No. Everything builds in the cloud. Upload your zip and download a real native binary. You need no local SDKs and no native toolchain.
Do other 2D engines also work?
Yes. html2app wraps any HTML5 project, so Pixi.js, Excalibur.js and Kaboom.js convert the same way. Read the Pixi.js guide for 2D and 3D Pixi games.

Not only Phaser. html2app wraps any HTML5 game or app.

Three.js Pixi.js JavaScript React Pixi.js 2D and 3D guide

Ship your Phaser.js game to the store

Built by a Phaser game developer. Convert your first game for free. No credit card and no native code.