用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/G1Joshi/Agent-Skills --skill cordova命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | cordova |
| description | Apache Cordova hybrid mobile framework. Use for hybrid apps. |
Apache Cordova (formerly PhoneGap) wraps HTML/CSS/JS apps in a native WebView container. While largely superseded by Capacitor and React Native, it remains active (CLI 13.x) for specific legacy use cases.
npm install -g cordova
cordova create hello com.example.hello HelloWorld
cd hello
cordova platform add android
cordova platform add ios
cordova run android
The most critical event. You cannot call any native plugins until this fires.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log("Running cordova-" + cordova.platformId);
}
The central configuration file for build settings, permissions, and plugin declarations.
Interfaces to native code.
cordova-plugin-camera, cordova-plugin-device, etc.Many teams use Capacitor as a drop-in replacement runner for Cordova apps to modernize the buildstack while keeping the frontend code.
npm install @capacitor/cli @capacitor/core
npx cap init
# Capacitor automatically reads config.xml and supports most Cordova plugins
Do:
www folder stateless (build artifacts).Content-Security-Policy meta tags strictly to prevent XSS.Don't:
platforms/ directory directly (it gets overwritten).| Error | Cause | Solution |
|---|---|---|
deviceready not firing | JS error before event or missing cordova.js. | Check console; ensure cordova.js is included in index.html. |
White Screen | CSP blocking scripts or syntax error. | Check Content-Security-Policy and remote debugging. |
Gradle build failed | Java/Gradle version mismatch. | Check cordova requirements android output. |