feat: Android APP V1 - Experimental Alpha

This commit is contained in:
2026-06-05 07:40:25 +02:00
parent bf4e6891d1
commit 9a1305f976
179 changed files with 8031 additions and 120 deletions

45
tools/cap-open-android.js Normal file
View File

@@ -0,0 +1,45 @@
'use strict';
const { spawn } = require('child_process');
const path = require('path');
const { resolveAndroidStudioPath } = require('./resolve-android-studio-path');
function main() {
const studioPath = resolveAndroidStudioPath();
if (!studioPath) {
console.error(
'[error] Unable to locate Android Studio (studio.sh).\n'
+ ' Install Android Studio or set CAPACITOR_ANDROID_STUDIO_PATH to studio.sh.'
);
process.exit(1);
}
const tojuAppDir = path.resolve(__dirname, '..', 'toju-app');
const child = spawn('npx', ['cap', 'open', 'android'], {
cwd: tojuAppDir,
env: {
...process.env,
CAPACITOR_ANDROID_STUDIO_PATH: studioPath
},
stdio: 'inherit',
shell: process.platform === 'win32'
});
child.on('error', (error) => {
console.error(error instanceof Error ? error.message : String(error));
process.exit(1);
});
child.on('exit', (code, signal) => {
if (signal) {
process.kill(process.pid, signal);
return;
}
process.exit(code ?? 0);
});
}
main();