ionic-cli: Ionic 4 - Ionic 5.0.0 CLI - Livereload to device not working - freezing at splash screen
Description: I would like to be able to serve the app to my physical iPhone plugged into my Macbook with console logs to the terminal and not the DevApp. It appears by the docs and change logs that should be possible, but it was not getting past the splash screen. I have tried ionic cordova run ios -l, ionic cordova run ios --livereload, ionic cordova run ios --device -l --address=0.0.0.0, ionic cordova run ios --device -l --address=0.0.0.0 -disableHostCheck, etc. I was copying the exact commands from the CLI release note docs. I have tried with a physical device and simulator. The building is not the issue. It is when it goes to run it on the device that it hangs up. I am able to ionic cordova run ios no problem without live reload. I am also able to ionic cordova build ios and then open it in XCode and run it no problem there. It would be great to get this resolved and I would be happy to provide any info that is needed.
I finally got it to build and got things updated and installed and the Livereload is not working. For a while I was getting an error that said nodeModule is null. I resolved that issue and both ionic cordova run ios and cordova run ios are launching the app. When I try ionic cordova run ios -l or --livereload it acts like it is building and no errors but it hangs on the splashscreen and won’t go beyond that. I have been testing with this a majority of the day and has been difficult to nail down the issues. It also appears that the Legacy or New Build system in iOS is no longer important to it being able to build. I also tried the clearing the network settings on my iPhone and got a new Trust pop up that I accepted. It seemed to get closer after I did that but would stay loading on the splash screen. Yes I am using Angular.
I got it to at least get past the splash screen but only on iOS emulator, NOT device, and there is no console logging with any of it.
Output:
My ionic info
:
Ionic:
Ionic CLI : 5.0.0 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/angular 4.4.2 @angular-devkit/build-angular : 0.13.9 @angular-devkit/schematics : 7.3.9 @angular/cli : 7.3.9 @ionic/angular-toolkit : 1.5.1
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1) Cordova Platforms : ios 5.0.1 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 4 other plugins)
Utility:
cordova-res : 0.3.0 native-run : 0.2.2
System:
Android SDK Tools : 26.1.1 (/Users/taylorkorensky/Library/Android/sdk) ios-deploy : 1.9.4 ios-sim : 8.0.1 NodeJS : v10.15.3 (/usr/local/bin/node) npm : 6.9.0 OS : macOS Mojave Xcode : Xcode 10.2.1 Build version 10E1001
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 23 (4 by maintainers)
With Ionic CLI 5.0.1 with this command, I was able to live reload and console log to my iPhone device connected to my computer.
ionic cordova run ios -l --address=0.0.0.0 --consolelogs
Thanks!
@bnallmaster Let’s debug. I want to try to tackle the biggest issue first: getting past the splash screen.
Please try running
ionic cordova run ios -l --no-native-run
.@bnallmaster @dwieeb
ionic cordova run ios --address=0.0.0.0 --device --consolelogs --livereload
. However, I notice all my in-app API calls to my back end server (all using $http) are no longer working - something special I have to do about those calls? If I just deploy the app to my test iPhone without live-reload, all my api server calls work just fine. Using Safari web-inspector, I see the api server calls in the network section coming back with error: “Failed to load resource: Origin http://192.168.4.16:8100 is now allowed by Access-Control-Allow-Origin”.I added
<allow-navigation href="http://192.168.4.16:8100" />
to my config.xml file, but that didn’t help. I also specifically allowed:<allow-navigation href="http://api.myserver.com/v1/*/*" />
to no avail either.ionic cordova run android -l
orionic cordova run android -l --address=0.0.0.0 --device
- launches the live-reload service, launches the app the to the test android phone (directly connected to computer), the service sees changes in thewww
folder, but the app refresh on the phone never happens…it never updates/reloads with the new changes.Additionally, when the app is deployed to the Android device - even though live-reload doesn’t want to work, I am able to use Chrome web-inspector and see that all my server api calls are working
I am so confused.
echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
Enter this in console. worked for me.
it works with cordova@9.0.0
Just run (for same network)
ionic cordova run ios --address=0.0.0.0 --device --consolelogs --livereload
wait until it compiled -> push the app to the phone via xcode