poetic/ember-cli-cordova

Be more specific about how to run liveReload

Opened this issue · 3 comments

Suven commented

Hey,

I am unsure about wether liveReload is an Emulator-only or on-device feature (on Android).

If it is an on-device feature: In which order do I need to execute the cli-tasks?

I tried the following:

  1. ember serve
  2. ember cordova run -platform=android

The problem with this is that the App then tries to locate a ember-cli-live-reload.js under file:// which is not present.

When using ember cordova:build instead of run, it does not even try to include this file, or to open a socket.

That's how my env is set:

cordova: {
      rebuildOnChange: false,
      emulate: false,
      platform:'android',
      emberUrl:'http://192.168.178.36:4200',
      liveReload:{
        enabled:true,
        platform:'android',
      },
} 
Suven commented

I got it working on iOS, but am still struggeling with Android. It seems that on Android all files are always still served from the file-assets-folder instead of the remote location.

I am using Cordova 5 and this changed env-settings:

// Debugging
remoteDebugHost: '192.168.178.29',
remoteDebugScheme: 'http',
cordova: {
  emberUrl: 'http://192.168.178.29:4200',
  rebuildOnChange: false,
  emulate: false,
  liveReload: {
    enabled: true,
    platform: 'android'
  }
},

As a workaround I am currently replacing the content-src in the config.xml with my dev-machines ip which enables me to use liveReload. This has the downside of requireing me to run cordova run, which skips all ember-cordova-cli tasks.

Just made a PR for this
#170

I only tested on Android. Would be nice to get some feedback with iOS

Suven commented

Thanks @mauricioac !

I will definitely check this out on both platforms.