命令参考
NativePHP Mobile 中所有可用的 native:* Artisan 命令完整参考。
开发命令
native:install
将 NativePHP 安装到你的 Laravel 应用程序中。
shell
php artisan native:install {platform?}| 选项 | 描述 |
|---|---|
platform | 目标平台:android、ios 或 both |
--force | 覆盖现有文件 |
--fresh | --force 的别名 |
--with-icu | 为 Android 包含 ICU 支持(增加约 30MB) |
--without-icu | 为 Android 排除 ICU 支持 |
--skip-php | 不下载 PHP 二进制文件 |
native:run
在设备或模拟器上构建并运行应用。
shell
php artisan native:run {os?} {udid?}| 选项 | 描述 |
|---|---|
os | 目标平台:ios 或 android |
udid | 特定设备/模拟器的 UDID |
--build=debug | 构建类型:debug、release 或 bundle |
--watch | 在开发期间启用热重载 |
--start-url= | 要加载的初始 URL/路径(例如 /dashboard) |
--no-tty | 为非交互式环境禁用 TTY 模式 |
native:watch
监视文件更改并同步到正在运行的移动应用。
shell
php artisan native:watch {platform?} {target?}| 选项 | 描述 |
|---|---|
platform | 目标平台:ios 或 android |
target | 要监视的设备/模拟器 UDID |
native:jump
启动 NativePHP 开发服务器,无需构建即可测试移动应用。
shell
php artisan native:jump| 选项 | 描述 |
|---|---|
--platform= | 目标平台:android 或 ios |
--host=0.0.0.0 | 服务器监听的主机地址 |
--http-port= | 服务器监听的 HTTP 端口 |
--laravel-port=8000 | 要代理的 Laravel 开发服务器端口 |
--no-mdns | 禁用 mDNS 服务广播 |
--skip-build | 如果 app.zip 存在则跳过构建 |
native:open
在 Xcode 或 Android Studio 中打开原生项目。
shell
php artisan native:open {os?}| 选项 | 描述 |
|---|---|
os | 目标平台:ios 或 android |
native:tail
从正在运行的 Android 应用跟踪 Laravel 日志。(仅限 Android)
shell
php artisan native:tailnative:version
显示当前 NativePHP Mobile 版本。
shell
php artisan native:version构建和发布命令
跳过复杂性
在本地管理证书、配置文件和密钥库既繁琐又容易出错。 Bifrost 为你处理所有这些——只需设置一次凭据,用一个命令部署,轻松与团队协作。
native:package
打包应用以进行签名分发。
shell
php artisan native:package {platform}| 选项 | 描述 |
|---|---|
platform | 目标平台:android 或 ios |
--build-type=release | 构建类型:release 或 bundle |
--output= | 签名产物的输出目录 |
--jump-by= | 在版本编号中向前跳跃 |
--no-tty | 为非交互式环境禁用 TTY 模式 |
Android 选项:
| 选项 | 描述 |
|---|---|
--keystore= | Android 密钥库文件路径 |
--keystore-password= | 密钥库密码 |
--key-alias= | 签名的密钥别名 |
--key-password= | 密钥密码 |
--fcm-key= | 用于推送通知的 FCM 服务器密钥 |
--google-service-key= | Google 服务账号密钥文件路径 |
--upload-to-play-store | 打包后上传到 Play Store |
--play-store-track=internal | Play Store 轨道:internal、alpha、beta、production |
--test-push= | 使用现有 AAB 文件测试 Play Store 上传(跳过构建) |
--skip-prepare | 跳过 prepareAndroidBuild() 以保留现有项目文件 |
iOS 选项:
| 选项 | 描述 |
|---|---|
--export-method=app-store | 导出方法:app-store、ad-hoc、enterprise、development |
--upload-to-app-store | 打包后上传到 App Store Connect |
--test-upload | 测试上传现有 IPA(跳过构建) |
--validate-only | 仅验证归档而不导出 |
--validate-profile | 验证配置文件授权 |
--rebuild | 通过删除现有归档强制重建 |
--clean-caches | 构建前清除 Xcode 和 SPM 缓存 |
--api-key= | App Store Connect API 密钥文件路径(.p8) |
--api-key-id= | App Store Connect API 密钥 ID |
--api-issuer-id= | App Store Connect API 发行者 ID |
--certificate-path= | 分发证书路径(.p12/.cer) |
--certificate-password= | 证书密码 |
--provisioning-profile-path= | 配置文件路径(.mobileprovision) |
--team-id= | Apple 开发者团队 ID |
native:release
在 .env 文件中升级版本号。
shell
php artisan native:release {type}| 选项 | 描述 |
|---|---|
type | 发布类型:patch、minor 或 major |
native:credentials
为 iOS 和 Android 生成签名凭据。
shell
php artisan native:credentials {platform?}| 选项 | 描述 |
|---|---|
platform | 目标平台:android、ios 或 both |
--reset | 生成新的密钥库和 PEM 证书 |
native:check-build-number
验证并建议应用的构建编号。
shell
php artisan native:check-build-number插件命令
native:plugin:create
以交互方式创建新的 NativePHP 插件脚手架。
shell
php artisan native:plugin:createnative:plugin:list
列出所有已安装的 NativePHP 插件。
shell
php artisan native:plugin:list| 选项 | 描述 |
|---|---|
--json | 以 JSON 格式输出 |
--all | 显示所有已安装的插件,包括未注册的 |
native:plugin:register
在 NativeServiceProvider 中注册插件。
shell
php artisan native:plugin:register {plugin}| 选项 | 描述 |
|---|---|
plugin | 包名(例如 vendor/plugin-name) |
--remove | 移除插件而不是添加它 |
--force | 跳过冲突警告 |
native:plugin:uninstall
完全卸载插件。
shell
php artisan native:plugin:uninstall {plugin}| 选项 | 描述 |
|---|---|
plugin | 包名(例如 vendor/plugin-name) |
--force | 跳过确认提示 |
--keep-files | 不删除插件源目录 |
native:plugin:validate
验证插件的结构和清单。
shell
php artisan native:plugin:validate {path?}| 选项 | 描述 |
|---|---|
path | 特定插件目录的路径 |
native:plugin:make-hook
为插件创建生命周期钩子命令。
shell
php artisan native:plugin:make-hooknative:plugin:boost
为插件创建 Boost AI 指南。
shell
php artisan native:plugin:boost {plugin?}| 选项 | 描述 |
|---|---|
plugin | 插件名称或路径 |
--force | 覆盖现有指南 |
native:plugin:install-agent
安装用于插件开发的 AI 代理。
shell
php artisan native:plugin:install-agent| 选项 | 描述 |
|---|---|
--force | 覆盖现有代理文件 |
--all | 安装所有代理而不提示 |