简体   繁体   中英

“cordova run android” does not reflect changes on device/emulator

I have tried many different solutions from google to get new changes reflected but NO LUCK.

Things Tried.
- platform remove and add again
- deleting APK file
- setting cache off in index.html
- changing version in config file
- modifying app_id
- etc.

ionic info

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.2.3 browser 4.1.0
    Ionic Framework                 : ionic-angular 3.4.0

System:

    Node       : v6.11.0
    OS         : Windows 7
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 5.0.3

After trying almost all the solutions provided by different members of ionic forum and stackoverflow I found out that If I run

ionic serve 

then stopping it, and then

cordova run android

have solved my problem. Without following this sequence I'm not able to see the changes reflected directly on android device/emulator.

I don't know the exact logic behind it but in my case it is working like this.

I think you are looking for following command

ionic cordova run android --livereload -cs

For more information and details see

ionic cordova run android --help

Uninstall the existing app, run a cordova prepare and try re-running the app. Sometimes the existing app might not get overwritten properly. Also for your changes to propagate to the platform folder, a prepare has to be executed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM