
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
lynx-native-cli
Advanced tools
🚀 CLI tool to generate native Android/iOS/Web projects for Lynx apps - like Capacitor for Lynx
一键生成 Android、iOS、Web、HarmonyOS 原生项目的 Lynx CLI 工具
Generate native Android/iOS/Web/HarmonyOS projects for Lynx apps with one command
像 Capacitor 一样简单的 Lynx 跨平台开发工具!
npm install -g lynx-native-cli
或者直接使用 npx:
npx lynx-native-cli init
⚠️ 注意: 请确保安装的是
lynx-native-cli而不是lynx-cli(这是另一个不同的包)
lynx add android 生成完整的 Android 项目doctor 命令检查开发环境devices 命令列出连接设备logs 命令查看应用日志clean 命令清理构建缓存cd your-lynx-project
lynx init
# Android
lynx add android
# iOS (需要 macOS)
lynx add ios
# Web
lynx add web
# HarmonyOS (鸿蒙)
lynx add harmony
npm run build
lynx sync
# Android APK
lynx build android
# iOS (需要 macOS)
lynx build ios
# Web 开发服务器
lynx run web
lynx init # 创建配置文件
lynx add android # 添加 Android 项目
lynx add ios # 添加 iOS 项目
lynx add web # 添加 Web 项目
lynx add harmony # 添加 HarmonyOS 项目
lynx sync # 同步 bundle 到所有平台
lynx sync --platform android # 同步到指定平台
# 基本构建
lynx build android # 构建 Debug APK
lynx build android --release # 构建 Release APK
lynx build ios # 构建 iOS
lynx build web # 构建 Web
# 架构特定构建
lynx build android --arch arm64 # 只构建 ARM64 架构
lynx build android --arch arm32 # 只构建 ARM32 架构
lynx build android --arch x86 # 只构建 x86 架构
lynx build android --arch universal # 通用 APK
# 签名构建
lynx build android --signed --release # 构建签名 APK
# 运行应用
lynx run android # 安装并运行到设备
lynx run ios # 运行到 iOS 模拟器
lynx run web # 启动 Web 开发服务器
lynx open android # 在 Android Studio 中打开
lynx open ios # 在 Xcode 中打开
lynx open web # 在 VS Code 中打开
lynx doctor # 检查开发环境
lynx devices # 列出所有连接的设备
lynx devices --android # 只显示 Android 设备
lynx devices --ios # 只显示 iOS 设备
lynx logs android # 查看 Android 应用日志
lynx logs android --device <id> # 指定设备
lynx logs android --level W # 设置日志级别 (V/D/I/W/E)
lynx logs android --clear # 清空历史日志
lynx logs android --all # 显示所有日志(不过滤应用)
lynx clean # 清理所有构建缓存
lynx clean --all # 包括 node_modules
lynx clean --android # 只清理 Android 缓存
lynx clean --ios # 只清理 iOS 缓存
lynx clean --native # 只清理原生平台缓存
运行 lynx add 后,你的项目会变成:
my-lynx-project/
├── src/ # 你的 Lynx 源码
├── dist/ # 构建输出
│ └── main.lynx.bundle
├── android/ # Android 项目
│ ├── app/
│ │ └── src/main/assets/
│ │ └── main.lynx.bundle
│ └── build.gradle.kts
├── ios/ # iOS 项目
│ ├── App/
│ │ ├── Sources/
│ │ └── Assets/
│ │ └── main.lynx.bundle
│ └── Podfile
├── web/ # Web 项目
│ ├── src/
│ ├── public/assets/
│ │ └── main.lynx.bundle
│ └── package.json
├── harmony/ # HarmonyOS 项目
│ ├── lynx_explorer/
│ │ └── src/main/resources/rawfile/
│ │ └── main.lynx.bundle
│ └── oh-package.json5
└── lynx.config.json # CLI 配置
运行 lynx doctor 检查你的环境。
{
"appName": "My App",
"appId": "com.example.app",
"distDir": "dist",
"bundleName": "main.lynx.bundle",
"platforms": {
"android": {
"path": "android"
},
"ios": {
"path": "ios"
},
"web": {
"path": "web"
},
"harmony": {
"path": "harmony"
}
}
}
# Debug APK
lynx build android
# Release APK
lynx build android --release
APK 输出位置:android/app/build/outputs/apk/
lynx run android
cd ios
pod install
lynx build ios
lynx run ios # 在模拟器中运行
cd web
npm install
lynx run web
| 功能 | Lynx 官方 | Lynx Native CLI |
|---|---|---|
| 生成原生项目 | ❌ 手动集成 | ✅ 一键生成 |
| 多平台支持 | ✅ | ✅ |
| 构建流程 | 🔧 复杂 | 🚀 简单 |
| IDE 集成 | ❌ | ✅ |
| 环境检测 | ❌ | ✅ |
# 1. 项目初始化
lynx init
# 2. 添加平台
lynx add android
lynx add ios
# 3. 开发调试
npm run dev # 启动 Lynx 开发服务器
lynx devices # 查看连接的设备
lynx sync # 同步 bundle
lynx run android # 运行到设备
lynx logs android # 查看实时日志
# 4. 构建发布
npm run build # 构建 Lynx 应用
lynx sync # 同步到原生项目
lynx build android --arch arm64 --signed # 构建签名 APK
# 环境检查
lynx doctor
# 设备管理
lynx devices --android # 只看 Android 设备
lynx logs android --level E # 只看错误日志
lynx logs android --device xxx # 指定设备日志
# 项目维护
lynx clean # 清理构建缓存
lynx clean --all # 完全清理(包括依赖)
# 小体积 APK(推荐)
lynx build android --arch arm64
# 兼容性 APK
lynx build android --arch universal
# 发布版本
lynx build android --signed --release --arch arm64
欢迎提交 Issue 和 PR!
MIT License
让 Lynx 开发像 Capacitor 一样简单!
FAQs
🚀 CLI tool to generate native Android/iOS/Web projects for Lynx apps - like Capacitor for Lynx
We found that lynx-native-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.