无法运行ionic platform命令

时间:2017-05-11 03:19:32

标签: ios cordova ionic-framework

我想为我的离子应用程序获得一个ios构建(框架的v1用于)。查看文档,似乎我必须运行以下命令 -

teacher.info

但是,运行此命令会给我一条消息 -

ionic platform add ios
ionic platform build ios

认为可能存在重命名命令的新更新,我运行了The platform command has been renamed. To find out more, run: ionic cordova platform --help ,只获得了

ionic cordova platform --help

我开始认为这只是我机器上的一些奇怪的错误,因为到目前为止还没有人在网上重新发布这个错误。当我尝试运行其他ios命令时,我收到相同的消息,例如[ERROR] Unable to find command: cordova platform _ _ (_) (_) _ ___ _ __ _ ___ | |/ _ \| '_ \| |/ __| | | (_) | | | | | (__ |_|\___/|_| |_|_|\___| CLI 3.0.0 Usage: $ ionic <command> [arguments] [options] $ ionic <command> --help (for command details) Global Commands: docs ................ Open the Ionic documentation website info ................ Print system/environment info login ............... Login with your Ionic ID signup .............. Create an Ionic account start ............... Create a new project telemetry ........... Opt in and out of telemetry Project Commands: generate ............ Generate pipes, components, pages, directives, providers, and tabs (ionic-angular >= 3.0.0) (alias: g) link ................ Connect your local app to Ionic serve ............... Start a local development server for app dev/testing upload .............. Upload a new snapshot of your app package build ....... Start a package build package download .... Download your packaged app package info ........ Get info about a build package list ........ List your cloud builds Options: --verbose ........... Verbose output for debugging --help .............. Show help for provided command ionic build ios

请告诉我如何生成构建,以便我可以在真正的ios设备中测试应用程序。

4 个答案:

答案 0 :(得分:31)

想出来!正确的命令是

ionic cordova platform add ios 
ionic cordova build ios

答案 1 :(得分:1)

documentation所示,您只是忘记在命令中添加cordova

ionic cordova platform add ios
ionic cordova platform build ios

答案 2 :(得分:0)

我在将android设备添加到离子时遇到了同样的问题,所以按照下面的命令进行操作并且正在为我工​​作。

ionic cordova platform add android

答案 3 :(得分:0)

首先请确保您已安装cordova 例如:如果您正在使用像npm这样的软件包管理器。 命中:

npm install cordova -g

然后:

  ionic cordova platform add android
  ionic cordova platform add ios