Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to run ionic platform commands

I want to get an ios build for my ionic app (v1 of the framework was used to ). Looking at documentation, it seems like I would have to run the following commands -

ionic platform add ios
ionic platform build ios

However, running this command gives me a message-

The platform command has been renamed. To find out more, run:

  ionic cordova platform --help

Thinking that maybe there's been a new update that renamed the commands, I ran ionic cordova platform --help, to only get

[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

I'm starting to think that it's some weird error with my machine only, as no one has so far reposted this on the web. I get the same messages when I try to run other ios commands like ionic build ios and ionic emulate ios

Please advise me on how to generate a build so I can test the app in real ios devices.

like image 975
keshinpoint Avatar asked May 11 '17 03:05

keshinpoint


People also ask

How do I test an ionic app in my browser?

Open the Chrome browser and navigate to the URL chrome://inspect/#devices . Your connected Android device should show up in the list of Remote Targets. On your device, open the Ionic app that you would like to debug using Chrome.


2 Answers

Figured it out! The right command is

ionic cordova platform add ios 
ionic cordova build ios
like image 152
keshinpoint Avatar answered Sep 29 '22 07:09

keshinpoint


As seen in the documentation, you have simply forgotten to add cordova to the command:

ionic cordova platform add ios
ionic cordova platform build ios
like image 21
Rafał Gołubowicz Avatar answered Sep 29 '22 09:09

Rafał Gołubowicz