user17135312
user17135312

Reputation:

What is the command to run ionic/capacitor app on device with live reload for android and ios

I have ionic capacitor project and I am trying to run it on device. Need help for android livereload debugging as i am using windows machine

Upvotes: 1

Views: 16446

Answers (3)

Sawan Patidar
Sawan Patidar

Reputation: 1

ionic cap run -l --external

It will ask for platform to select

Upvotes: 0

demhadesigns
demhadesigns

Reputation: 196

Important hint: Make sure that you do not have any eslint errors or warnings when running the command ionic cap run android --external -livereload, otherwise it will not perform the bundle build and it will not deploy the app to your selected device. I've spent hours to figure that out.

Upvotes: 2

Vishal Srivastava
Vishal Srivastava

Reputation: 350

Making sure that we have already setup jdk and android studio. We give following commands:

For android :

  1. ionic cap add android
  2. ionic cap sync
  3. ionic cap build android
  4. ionic cap run android --external -livereload
  5. Choose the device to deploy app. If your device is connected to pc then select the your device name else select from the list of emulators

The compiled android project might open on android studio for generating apk build. Even then you can hit run button to see the app on device.

For ios:

  1. ionic cap add ios
  2. ionic cap sync
  3. ionic cap build ios
  4. ionic cap run ios --external -livereload
  5. Choose the device to deploy app. If your device is connected to pc then select the your device name else select from the list of simulators

The compiled ios project might open on xcode studio for generating ipa build. Even then you can select simulator to see the app on device.

NOTE: All commands with respect to ionic 5 and above.

Upvotes: 12

Related Questions