Appearance
Native Mobile Play
ReGame runs games on Android and iOS through the native shell in templates/mobile-native. A ReGame project remains a data-only project; normal device Play prepares its scenes, RGScript, imported DataAssets, and assets into that shared shell.
React Native, Expo Runtime, Metro, Hermes, Babel, and a JavaScript application bundle are not part of the game runtime. Node.js runs the desktop export preparation tool, then Gradle or Xcode builds the native C++ runtime.
Normal Play
Run Project on Device uses mainScene from project.json. The scene must be registered in the project's scenes list. Its viewport, stretch, and handheld orientation settings become the display contract in regame-export.json.
The editor performs these observable steps:
- Validate the project, selected device, and native platform tools.
- Run
prepare-mobile-export.cjswithout a--sceneoverride. - Update a reusable native play workspace under
.regame/mobile/editor-play/. - Boot or verify the exact selected Android serial or iOS UDID.
- Build the staged Gradle or Xcode project.
- Install and launch the native application on that same device.
Preparation, staging, build, install, launch, failure, and stop transitions are reported through the mobile runner's status, step, and output callbacks.
Run Current Scene
An explicit --scene <registered-scene> argument overrides mainScene for one prepared export. This is reserved for Run Current Scene on Device; normal device Play does not pass it.
Incremental Builds
Preparing new game content updates the native template, engine, and project inputs while preserving Gradle, CMake, CocoaPods, and Xcode build caches. A clean is performed only when explicitly requested. The runner does not start a development server, reverse a TCP port, or invoke a JavaScript mobile CLI. For Android, the selected device ABI is passed through ReGame's regameAbis Gradle property. The native template applies that value to CMake's abiFilters while retaining Gradle's standard app/build/outputs/apk/<variant>/ artifact location.
Manual Preparation
From the repository root:
sh
node packages/regame/editor-native/scripts/prepare-mobile-export.cjs \
--project apps/MyGame12Use --content-root to package one game in a project collection while keeping all referenced resources at their project-relative paths:
sh
node packages/regame/editor-native/scripts/prepare-mobile-export.cjs \
--project apps/MyGame12 \
--content-root src/projects/BurgerRush \
--name "Burger Rush" \
--application-id com.regame.burgerrushFor the complete prepared directory layout, local native commands, EAS signing boundary, and renderer coverage, see docs/mobile-native-export.md in the ReGame repository.
Platform Requirements
- Android: Android SDK platform-tools, Gradle wrapper prerequisites, an online physical device or configured emulator, and Java 17.
- iOS: macOS, Xcode command-line tools, CocoaPods, and an available Simulator or provisioned physical device.
The selected device ID is never replaced by an arbitrary online device. An AVD name may resolve to the serial of the emulator instance that it starts.
Lifecycle and Cleanup
Stopping mobile Play terminates the runner-owned preparation or build child process and its process group. It does not terminate unrelated processes or reserve a port. The installed native game remains owned by the device after a successful launch.
