iOS builds old files and livereload doesn't work

It seems that my emulator and my iphone was pulling code from Ionic’s git.
When I was connected to the internet it was downloading some data and then I figured out that it was taking the code from Ionic’s git. When I was offline it was pulling my local code

I guess that’s the part of Ionic that makes it easy to update the app without actually uploading new version to the app store

That was what I meant with:

It normally doesn’t do this by itself, it has to be configured to work that way.

I have this

 "cordova-plugin-ionic": {
                "APP_ID": "xxx",
                "CHANNEL_NAME": "Master",
                "UPDATE_METHOD": "auto",
                "UPDATE_API": "https://api.ionicjs.com",
                "MAX_STORE": "2"
            },

Yep, that is the new way to do it.

Now you know it works :wink:

I’ll write tutorial about it and post it in this forum for other users and people who got stuck with it

1 Like

I have run into this same issue but these fixes did not work for me.

  "cordova-plugin-ionic": {
    "APP_ID": "e8ecd9c9",
    "CHANNEL_NAME": "Master",
    "UPDATE_METHOD": "auto",
    "UPDATE_API": "https://api.ionicjs.com",
    "MAX_STORE": "2"
  }

But I do not plan on using Ionic deploy. Is there a way to remove this and see if this fixes my problem.

I have tried removing platform ios, removing derived data, and doing ionic serve or prepare and the app still loads old files

Do this

cordova plugin rm cordova-plugin-ionic --save

Removed the cordova plugin.
Changed the build number

UPDATE: for anyone that runs into my issue. This may not be a long term fix if I have to keep removing/adding the ios platforms to have successful builds but I hope not.

  1. First build after removing platform ios:

=== BUILD TARGET Rewardzzz OF PROJECT Rewardzzz WITH CONFIGURATION Debug ===

Check dependencies
Code Signing Error: Signing for “Rewardzzz” requires a development team. Select a development team in the project editor.
Code Signing Error: Code signing is required for product type ‘Application’ in SDK ‘iOS 11.1’

** ARCHIVE FAILED **

The following build commands failed:
Check dependencies
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/simpledev/Development/Rewardzzz-App/platforms/ios/cordova/build-debug.xcconfig,-workspace,Rewardzzz.xcworkspace,-scheme,Rewardzzz,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,Rewardzzz.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/simpledev/Development/Rewardzzz-App/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/simpledev/Development/Rewardzzz-App/platforms/ios/build/sharedpch

[ERROR] An error occurred while running cordova build ios (exit code 1).

  1. Then go to xCode and set provisioning profiles to manual and build again.

ionic cordova build ios

  1. Then go back to xCode

Following the steps below:

  1. Select the Target – > General → Signing → Select the Team (It must the Super account)
  2. Then select the Build Settings in Target, keep the Development team with the same with Selected team. Set the Provisoning Profile with Automatic and Code Signing Identity with iOS Developer.
  3. Select the Project – > Build Settings. Set the Provisoning Profile and Code Signing Identity with Details information

Run on device and it updated the files!

To send to Testflight
Project > Archive > Upload to TestFlight

“Now every time I dome some change I run ionic serve so my www folder is updated. Then I run ionic cordova prepare so it transfer www folder to platforms/ios. I don’t even have to clean project or delete DerivedData”

It worked for me !! Thanks :smiley: