Ionic-cli: Ionic 4 - Ionic 5.0.0 CLI - Livereload to device not working - freezing at splash screen

Created on 5 Jun 2019  ·  23Comments  ·  Source: ionic-team/ionic-cli

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:
Screen Shot 2019-06-04 at 3 47 53 PM

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 ([email protected])
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

triage

Most helpful comment

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!

All 23 comments

I was able to get livereloading and console log working with the iOS Simulator so far with this command. ionic cordova run ios --livereload --consolelogs. If I run the same command but with an iPhone device plugged in ... it gets stuck at the splash screen with the loading wheel. Please let me know if any other info would be valuable.

It also appears that the Legacy or New Build system in iOS is no longer important to it being able to build

Yep, I believe this is because you're using the latest cordova-ios (5.0.1 at time of writing).

I was able to get livereloading and console log working with the iOS Simulator so far with this command. ionic cordova run ios --livereload --consolelogs

Yep, if you want console log proxying, you have to include the option --consolelogs.

@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.

I am currently on CLI 5.0.0. It went through the entire build process. I ran the command above and it did the same splash screen hangup issue. Keep in mind this app is a brand new ionic start app with CLI 5.0.0 so nothing extra should be going on. Should I update to CLI 5.0.1?

5.0.1 doesn't appear to exist yet

Any recommendations on next steps to try @dwieeb?

This is working with the dev app and live reloading. ionic serve --devapp. Still stuck on getting it to livereload without freezing the splash screen on the physical device.

5.0.1 doesn't appear to exist yet

I said cordova-ios 5.0.1. That's the Cordova iOS platform. (ionic cordova platform ls to see it, or look at your package.json)

Is your device on the same Wi-Fi network as your computer?

Please post the full output of the following command:

ionic cordova run ios -l --address=0.0.0.0 --verbose

Please post the full output of the following command:

ionic cordova run ios -l --address=0.0.0.0 --verbose

log here it is sir,I have 100% on the same wifi network

  • If I try command ionic cordova run ios -l --no-native-run I have the same result, still sucking at splash screen sir

oh I see that error, is that problem?
image

I change that address to 192.168.0.106 is my local ip. the same result still happen:
image

Oh, by the way, I am able to load that IP 192.168.0.106 successful from other computer
image

confirm that it was fixed in ionic cli version 5.0.1 just release a few minute. I can successful run livereload now

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!

Awesome, great to hear this was fixed. 🎉

@dwieeb I am having the same issue for a while. When I try to livereload on iOS on a real device, the app gets stuck on white screen with a loading indicator as seen in the image below.

IMG_F7FBC67037D0-1

I tried ionic cordova run ios -l --no-native-run, but no luck.

What works for me is build and run the app with Xcode.

My ionic info:

Ionic:

   Ionic CLI                     : 5.1.0 (/Users/emre/.nvm/versions/node/v10.15.3/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.5.0
   @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 ([email protected])
   Cordova Platforms : ios 5.0.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 5 other plugins)

Utility:

   cordova-res : 0.3.0 (update available: 0.4.0)
   native-run  : 0.2.6 

System:

   Android SDK Tools : 26.1.1 (/Users/emre/Library/Android/sdk)
   ios-deploy        : 1.9.4
   ios-sim           : 8.0.1
   NodeJS            : v10.15.3 (/Users/emre/.nvm/versions/node/v10.15.3/bin/node)
   npm               : 6.9.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.2.1 Build version 10E1001

try ionic cordova run ios -l

Vào CN, 23 thg 6, 2019 vào lúc 20:26 Emre Erdoğan <
[email protected]> đã viết:

I am having the same issue for a while. When I try to livereload on iOS on
a real device, the app gets stuck on white screen with a loading indicator
as seen in the image below.

[image: IMG_F7FBC67037D0-1]
https://user-images.githubusercontent.com/2360385/59976915-97dd1f80-95d3-11e9-8f84-7ec7c82fc3d4.jpeg

I tried ionic cordova run ios -l --no-native-run, but no luck.

What works for me is run the app inside Xcode.

Here's my ionic info:

Ionic:

Ionic CLI : 5.1.0
(/Users/emre/.nvm/versions/node/v10.15.3/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.5.0
@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 ([email protected])
Cordova Platforms : ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3,
cordova-plugin-ionic-webview 4.1.0, (and 5 other plugins)

Utility:

cordova-res : 0.3.0 (update available: 0.4.0)
native-run : 0.2.6

System:

Android SDK Tools : 26.1.1 (/Users/emre/Library/Android/sdk)
ios-deploy : 1.9.4
ios-sim : 8.0.1
NodeJS : v10.15.3 (/Users/emre/.nvm/versions/node/v10.15.3/bin/node)
npm : 6.9.0
OS : macOS Mojave
Xcode : Xcode 10.2.1 Build version 10E1001


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ionic-team/ionic-cli/issues/4008?email_source=notifications&email_token=AEBPJ3U5S3AKI2ITJYWAKB3P352ZPA5CNFSM4HTHPEMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYK6QHI#issuecomment-504752157,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEBPJ3XYCWVVJR6UJGZLXATP352ZPANCNFSM4HTHPEMA
.

@hiepxanh

Thanks. Sorry, I was assuming it was obvious that I tried that already.

I belive that cordova problem, remove cordova-cli and install 8 version.
npm remove -g cordova
npm install -g [email protected]
if it not resolve your issue, please upload your project, I will looking to this

it works with [email protected]

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

@bnallmaster @dwieeb

  1. iOS: Thank, this fix worked for my iOS deployment..I see www changes happening real time: 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.

  1. Android: However, for ionic cordova run android -l or ionic 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 the www 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.

I cant able to run ios app via Vscode,its getting code signing error.Even i was set profiles manually in xcode.But in vscode its throwing me a error.Any help?

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!

still working

Was this page helpful?
0 / 5 - 0 ratings