Post/Code

HomeAboutUsesNow

Ionic Notes.

Android.

  • ng build // must ng build first so capacitor can wrap the app
  • ionic capacitor add android
  • ionic capacitor copy android
  • ionic capacitor run android // will combine all the above 3x (ng build, add and copy) into one for you
  • ionic capacitor run android -l // live reload in the emulator, will be running on ng serve behind the scenes instead of ng build

In Chrome: chrome://inspect

You should see a emulator target listed under “Devices” -> Click “Inspect” - this will connect a dev console to the running emulator.

iOS.

Similar to the above, however, you do need to make sure you have xCode Command Line Tools installed. You can check this by running from the command line:

  • xcode-select

  • sudo gem install cocoapods

  • ionic capacitor add ios

  • ng build

  • ionic capacitor copy ios

  • ionic capacitor run ios

  • ionic capacitor run ios -l // live reload

Open Safari, then select “Develop” menu, then select the “Simulator” device near the top. Should show an ip address and you can then view safari dev tools.

In “Debugger” tab, there are quite a lot of files, so you can type in the filename you are looking for and it should find it. Then you can set breakpoints as usual.