Xcode Simulator using cached files - ios

I am running a Cordova app and when I open it using Xcode (iOS Simulator) it shows the updated code files in Project Navigator. I then run Product -> Clean and run the code on the simulator but it still uses a previous version of the HTML/JS files.
How do I get the simulator to build again from the updates source files? It seems they are somehow cached and I can't seem to get it cleared.

Use cordova build ios first and then run the app in simulator.

Related

Why is ios packaging inconsistent with using xcode run directly?

The react native project uses xcode to run on the simulator and real machine, and the image resources are displayed normally, but after being packaged into ipa, some images will not be displayed. I've tried cleaning the project, rebuilding, but the result is still the same

iOS - Flutter audioplayers plugin error on xcode (Not found) on Release mode

When I test it on iOS Simulator on debug mode, it works fine but when I try to run on release mode on XCode it give me the following error:
Module 'audioplayers' not found
I use audioplayers 0.18.3
I remove the Pods and reinstall but not effect in release mode. Don't have problem with archive the app so is very strange. Need take screenshots of the app (in release mode, without debug banner) and I don't have a physical iOS device, so the only solution for me is take screenshots from iOS Simulator in release mode, but have this problem
Error Screenshot
PD: I'm running the .xcworkspace file.
PD2: I'm running flutter build ios and open xcode (.xcworkspace file), and run 'clean build folder' but the error persist
PD3: Sorry my bad english
Thanks since now!

Problem with running IOS simulator for my flutter app

I'm trying to run my flutter app on the IOS simulator and its not working. So tried on the most basic flutter app (create my_app and then tried to run it) and nothing seem to work!
Everything seems to work fine when I run it from the terminal until the linking and signing phase and that where I get the error, how can I fix it?
This is the error I get:
Unable to install
/Users/MyUserName/Desktop/my_app/build/ios/iphonesimulator/Runner.app on
82562E3A-E7BD-4FE0-9BF9-8BB9C7AD5F15. This is sometimes caused by a malformed
plist file:
ProcessException: Process exited abnormally:
An error was encountered processing the command
(domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Could not install at this time.
Failed to transfer ownership of path
/Users/MyUserName/Library/Developer/CoreSimulator/Devices/82562E3A-E7BD-4FE0-9BF9-8B
B9C7AD5F15/data/Containers/Shared/SystemGroup/systemgroup.com.apple.installcoord
inationd/Library/InstallCoordination/PromiseStaging/98CD703F-760F-4AAE-B991-BC2E
82D37D17/my_app.app to installd
Underlying error (domain=MIInstallerErrorDomain, code=103):
Failed to transfer ownership of path
/Users/MyUserName/Library/Developer/CoreSimulator/Devices/82562E3A-E7BD-4FE0-9BF9-8
BB9C7AD5F15/data/Containers/Shared/SystemGroup/systemgroup.com.apple.installcoo
rdinationd/Library/InstallCoordination/PromiseStaging/98CD703F-760F-4AAE-B991-B
C2E82D37D17/my_app.app to installd
Command: /usr/bin/xcrun simctl install 82562E3A-E7BD-4FE0-9BF9-8BB9C7AD5F15
/Users/MyUserName/Desktop/my_app/build/ios/iphonesimulator/Runner.app
Error launching application on iPhone 11 Pro Max.
Edit:
I updated my MacOS, Deeleted and reinstalled Xcode, I even tried to run the most simple swift app and I get always this same error, it looks like the build was successful but it unable to install. I still get this same error, what can I do?
This occurred when I opened the Simulator first and then updated XCode -- even without running the app until after XCode updated completely.
What worked for me:
Close Simulator completely (from the dock, right-click -> "Quit")
Close XCode (if applicable)
Run flutter clean
Re-open Simulator
Re-open XCode and let it compile
Run the app again
If it still does not work, try resetting the device at "Device" -> "Erase All Content and Settings..." from the Simulator menu.
I had the same issue a couple of days ago
What I did - and what fixed the problem - was to reset the simulator (Device -> Erase All Content and Settings), and then run $ flutter clean
You should now be able to run your app again
None of the above worked for me. I created another flutter application and copied it's ios folder to my project. Worked like a charm
Save time, just go to erase device content and settings from the emulator, then run flutter clean. App should run fine then.
Run flutter clean and then run your app again
If error persist, generate a new flutter project on Android studio. Replace the ${projectHome}/ios/Runner.xcodeproj folder with the ${newFlutterProjectHome}/iOS/Runner.xcodeproj. Your app should run fine now.
If error persist still, delete the ios folder and replace it with a new one copied from a freshly generated project.
This happens if the GoogleService-Info.plist is missing.
This also happens when you have updated your XCode and your simulator is in the background.
Close the simulator and open the Xcode, you will get an option to install additional tools, install them and then run the application.
An alternate solution is to run the Runner.xcworkspace app once from Xcode and this may fix it.
In my case it was because of hanging empty GoogleService-Info.plist file inside Xcode after migrating to new Firebase (FlutterFire) initialization.
Xcode is not a regular drag and drop IDE which directly maps project files to the ones in the file system. It rather caches file references. So even when you delete a .plist file, the Xcode still maintains a reference to it.
Simply opened Xcode IDE and removed .plist file (which updated project.pbxproj in turn). This helped me to compile the project fine.
I had this same issue recently. I found out I added my GoogleService-info.plist file to the subdirectory Runner and not the main Project directory Runner through xcode. I opened up xcode again, deleted the file and re-added it to the proper place and now everything is working correctly.
for this you have to give some value in CfBundleVersionShortString like
<key>CFBundleShortVersionString</key>
<string>1.0</string>
And Give the build value in Runner as 1.0 and version as 1.0
enter image description here
To be honest. it's really frustrating for the developers
This is how I fixed!
flutter clean
flutter pub get
go to ios folder
rm Podfile.lock
pod repo update
pod install
Then it works!

When I run cordova on ios it keeps building my old app

I started a cordova project a while again and needed to do a major update so I cloned the folder and rebuilt the app. I deleted the old xcode project and cordova app but when I run:
cordova run ios --device
it keeps bring up my old app even though its deleted and no where to be found. If I run it in xcode and target my device it works fine? Is there some kind of caching I need to delete?
It is an issue with xcode 10 and cordova 8. This fix is to use this instead:
cordova run ios --buildFlag='-UseModernBuildSystem=0'

I can’t get my iOS project to build my changes

I'm new to the iOS side of things and I’m having a huge issue. None of my changes I am making to my views are being built when I build iOS. I run
sudo cordova build ios
Then I open Xcode and “sign” it. I then run from Xcode to my test device. But no changes are made. Even when I remove the iOS platform, add it back, rebuild iOS, run from Xcode, my changes still have not taken effect in the build. Am I missing something?
After you update your view, the process is:
1. build the components and pages and copy the result into www dir.
2. copy the contents in www into ios project, with ionic prepare command.
3. build your ios project.
With the latest version of ionic, it will be done one one command ionic cordova build ios, but if you use some old version of ionic, maybe you need to run:
ionic build
ionic cordova build ios

Resources