solana-mobile
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSolana Mobile projects
Solana Mobile 项目
Set up and maintain Solana Mobile apps. The CLI does the scaffolding,
environment checks, and emulator management — prefer it over hand-rolled setup.
solana-mobileRun it without installing:
bash
npx solana-mobile@latest --helppnpx solana-mobile@latestbun x solana-mobile@latest搭建并维护Solana Mobile应用。 CLI可完成脚手架搭建、环境检查和模拟器管理——优先使用该工具而非手动配置。
solana-mobile无需安装即可运行:
bash
npx solana-mobile@latest --helppnpx solana-mobile@latestbun x solana-mobile@latestNon-negotiable constraint
不可妥协的限制条件
Mobile Wallet Adapter requires a development build. Expo Go will not work — MWA depends
on native Android modules that Expo Go does not bundle. If someone reports wallet
connection failing in Expo Go, that is the cause; there is no workaround, they need
.
expo run:androidAndroid is the only platform with wallet support. iOS builds run, but no MWA.
Mobile Wallet Adapter 需要开发构建版本,Expo Go 无法正常使用——MWA依赖Expo Go未打包的原生Android模块。如果有人反馈在Expo Go中钱包连接失败,这就是原因;没有解决办法,必须使用。
expo run:androidAndroid是唯一支持钱包的平台。iOS可构建运行,但不支持MWA。
First: work out which situation you are in
第一步:确定你的场景
| Situation | Do this |
|---|---|
| No project yet | Create a new project |
| Existing Expo app, no Solana | Read references/add-to-existing-app.md |
| Project exists, build or toolchain broken | Check the environment |
| Project exists, needs wallet features | Use the |
Create a new project
创建新项目
bash
npx solana-mobile@latest createInteractive by default. To skip the prompts, name the project and template:
bash
npx solana-mobile@latest create my-app --template expo-kit-walletUseful flags:
| Flag | Effect |
|---|---|
| Pick a template non-interactively |
| Package manager to use |
| Use the minimal template |
| Print the template catalog |
| Print template ids as a JSON array |
| Do not install dependencies |
| Do not initialise a git repo |
| Show what would happen, write nothing |
bash
npx solana-mobile@latest create默认是交互式操作。若要跳过提示,需指定项目名称和模板:
bash
npx solana-mobile@latest create my-app --template expo-kit-wallet实用标志:
| 标志 | 作用 |
|---|---|
| 非交互式选择模板 |
| 指定使用的包管理器 |
| 使用极简模板 |
| 打印模板目录 |
| 以JSON数组形式打印模板ID |
| 不安装依赖项 |
| 不初始化git仓库 |
| 展示操作内容但不实际写入 |
Choosing a template
选择模板
Templates come in two families. Pick an template. is the current
Solana client library, and these are the templates the CLI maintains most actively.
expo-kit-*@solana/kitReach for only when the user is deliberately continuing an existing
codebase, or asks for it by name. If they ask without a reason, say kit is the
better starting point before going along with it — a new app on web3.js starts life needing a
migration.
expo-web3js-*@solana/web3.jsexpo-kit-minimal| Template | Stack | Use for |
|---|---|---|
| Kit + MWA + Uniwind | Best default. Wallet connect, sign, send already wired |
| Kit | Bare starting point, no UI kit |
| Kit + Uniwind | Tailwind-style styling, no wallet yet |
| Kit + Privy + Uniwind | Privy auth instead of, or alongside, MWA |
| web3.js + MWA | Legacy wallet app |
| web3.js + RN Paper | Legacy, Material UI |
| web3.js | Legacy bare starting point |
Template ids are also accepted in full form.
Re-run rather than trusting this table if a template seems missing — the
catalog ships with the CLI, not with this skill.
gh:solana-mobile/templates/mobile/<name>--list-templates模板分为两类。优先选择模板。是当前的Solana客户端库,这些模板是CLI最积极维护的版本。
expo-kit-*@solana/kit仅当用户有意继续使用现有代码库,或明确要求时,才选择模板。若用户无理由提出此要求,建议优先使用kit模板——基于web3.js的新应用后续需要迁移。
@solana/web3.jsexpo-web3js-*expo-kit-minimal| 模板 | 技术栈 | 适用场景 |
|---|---|---|
| Kit + MWA + Uniwind | 最佳默认选项。已集成钱包连接、签名、发送功能 |
| Kit | 基础起点,无UI套件 |
| Kit + Uniwind | Tailwind风格样式,暂未集成钱包 |
| Kit + Privy + Uniwind | 使用Privy认证替代或搭配MWA |
| web3.js + MWA | 遗留钱包应用 |
| web3.js + RN Paper | 遗留应用,Material UI风格 |
| web3.js | 遗留基础起点 |
模板ID也支持完整的格式。若发现模板缺失,请重新运行查看——模板目录随CLI发布,而非本技能文档。
gh:solana-mobile/templates/mobile/<name>--list-templatesAfter scaffolding
脚手架完成后
bash
cd my-app && npm run androidThat runs , which builds and installs the development build. The first
Android build is slow (Gradle cold start); later builds reuse the cache.
expo run:androidbash
cd my-app && npm run android该命令会执行,构建并安装开发版本。首次Android构建速度较慢(Gradle冷启动);后续构建会复用缓存。
expo run:androidCheck the environment
检查环境
Before debugging a build failure, check the toolchain:
bash
npx solana-mobile@latest doctorIt reports on the local Android and Node toolchain with recommendations for anything
missing. gives a stable report worth parsing when you need to branch on a specific
check; adds resolved paths and diagnostics.
--json--verboseRun first whenever a build fails for reasons that are not obviously in app code.
doctor在调试构建失败问题前,先检查工具链:
bash
npx solana-mobile@latest doctor该命令会报告本地Android和Node工具链的状态,并针对缺失项给出建议。参数会生成一份稳定的报告,适合在需要根据特定检查结果分支处理时解析;参数会添加解析后的路径和诊断信息。
--json--verbose每当构建失败原因并非明显来自应用代码时,先运行检查。
doctorManage Android emulators
管理Android模拟器
bash
npx solana-mobile@latest emu list
npx solana-mobile@latest emu status
npx solana-mobile@latest emu create
npx solana-mobile@latest emu start my_phone
npx solana-mobile@latest emu stop my_phoneemuemulatorcreatedeleteimagesliststartstatusstopemu imagesinstalllistdeleteCreate a named emulator on a specific device profile:
bash
npx solana-mobile@latest emu create local_phone --device pixel_9bash
npx solana-mobile@latest emu list
npx solana-mobile@latest emu status
npx solana-mobile@latest emu create
npx solana-mobile@latest emu start my_phone
npx solana-mobile@latest emu stop my_phoneemuemulatorcreatedeleteimagesliststartstatusstopemu imagesinstalllistdelete基于特定设备配置文件创建命名模拟器:
bash
npx solana-mobile@latest emu create local_phone --device pixel_9Testing wallet flows on an emulator
在模拟器上测试钱包流程
A fresh emulator has no wallet app installed, so MWA has nothing to connect to. Install an
MWA-compatible wallet APK into the emulator first, or test on a physical Android device.
Anything gated on the Seeker Genesis Token needs a real Seeker device — see the
skill.
seeker-genesis-token全新的模拟器未安装钱包应用,因此MWA没有可连接的对象。需先在模拟器中安装兼容MWA的钱包APK,或在物理Android设备上测试。任何依赖Seeker Genesis Token的功能都需要真实的Seeker设备——请查看技能文档。
seeker-genesis-tokenReference material
参考资料
- references/add-to-existing-app.md — wiring Solana into an Expo app that already exists: crypto polyfill, providers, dependencies
- references/troubleshooting.md — build, polyfill, and emulator failures with known causes
- references/add-to-existing-app.md — 向现有Expo应用集成Solana:加密兼容补丁、提供者、依赖项
- references/troubleshooting.md — 已知原因的构建、兼容补丁和模拟器故障排查
Related skills
相关技能
- — connecting wallets, signing, sending transactions
solana-mobile-wallet - — verifying Seeker device ownership
seeker-genesis-token - —
seeker-domainsdomain name resolution.skr
For general non-mobile Solana work — Anchor or Pinocchio programs, Codama client generation,
testing, security review — use the Solana Foundation's skill instead.
installs it into , so a scaffolded project already has it.
solana-devcreate.agents/skills/solana-dev/- — 钱包连接、签名、交易发送
solana-mobile-wallet - — 验证Seeker设备所有权
seeker-genesis-token - —
seeker-domains域名解析.skr
对于非移动端的通用Solana开发工作——例如Anchor或Pinocchio程序、Codama客户端生成、测试、安全审查——请使用Solana基金会的技能。命令会将其安装到目录,因此通过脚手架创建的项目已包含该技能。
solana-devcreate.agents/skills/solana-dev/Links
链接
- CLI source: https://github.com/solana-mobile/solana-mobile-cli
- Templates: https://github.com/solana-mobile/templates
- Solana Mobile docs: https://docs.solanamobile.com