I made an iOS app with Xcode and Swift. In v2, I also updated Launch Screen and Launch Images.
I first installed v1 of my app from the App Store. When the new, v2, was available from the App Store I updated my app on my devices. That's an iPhone 5s with the newest iOS and an iPhone 7 Plus with the newest iOS.
After updating my app on the iPhone 7 Plus it still showed up the old Launch Screen. Restart didn't help. I had to delete and reinstall the app to get the new Launch Screen shown up.
On iPhone 5s I didn't get any Launch Screen or Launch Image, I got a black screen for the time the Launch Screen shot get shown. I deleted and reinstalled the app. That didn't help. I also had to restart the device after reinstalling the app to get the right v2 Launch Screen.
Why that strange behavior? What can I do? I cannot ask my users to reinstall the app and restart the devices.
After updating the Launch image, delete the application cache which is stored in DerivedData folder.
If you are using xib or storyboard for displaying LaunchScreen move the images into an asset catalog, rather than using the png filenames.
The only workaround that works for me was to add the images outside Images.xcassets folder. After modified this and rebuild the app, it worked expected.
Related
I have an ios app but am trying to add a launch image to the start. I am testing on an old ios 6 phone (which I think is the retina 4.7). I added the launch image in assets catalog like
I then have it mentioned like so:
When I run the app on my iPhone 6 device it has no load screen. What am I missing? I used to have a LaunchScreen.storyboard but I have all these images of the right size made and want to use those.
I've had this issue before and I believe it's a bug with Xcode. It will still be trying to use the LaunchScreen.storyboard file.
Try the following:
Clean your project.
Delete the app from the device/simulator.
Restart Xcode/Simulator and re-run.
See https://stackoverflow.com/a/33698093/5032154 for more info.
I have changed the appicon in xcode project. But My sharing extension keeps showing old one. When I delete appicon files then it shows nothing but when I add again it shows me old one.
By the way it shows correct in the simulator but not in device
Try to delete app, reboot device and install again. It's work for me.
As I understand, iOS save app icon and launch screen to cache after first app running and load it from cache until rebooting.
I've updated launch screen on an enterprise app, but it won't update when installed on an iPad with the existing app. I've tried completely deleting the app before installing a new version, but it still launches with the old launch screen image.
I've tried installing the new app on another iPad where this app was never installed and the new launch screen appears as expected. Both iPads run the same iOS v9. The app was built with xCode 7.2
In summary I've tried the following scenarios:
updating existing app (version 1) on iPad A - with a new app (version 2)
iPad A, loads the new app v2 with launch screen from version 1
installed new app (version 2) on iPad B, which never had this app.
iPad B, loads the new app v2 with correct launch screen
then I installed old app version 1 on iPad B
iPad B, now loads the old app v1 with launch screen from version 2
It seems the iPad somehow caches the launch screen from the very fist install regardless which version it is. Deleting the app and reinstalling does not seem to help and it does not look code related as the correct launch screen images was loaded on iPad B
I just had this problem and i found that deleting the app off the device or simulator, then restarting the device or simulator seems to fix the issue.
I found just restarting the device didn't work.
I had tried many kinds of solutions and restart your iPhone is the only way.
In xcode, under Assets.xcassets, I clicked on LaunchImage and then unchecked Universal, checked iPhone, unchecked iPhone, and checked Universal again. Then ran build and it cleared the old image.
Simulators and iPhone caches the launch images.
this can help you
1>Clear the derived data under your developer/xcode folder
2>reset the device by pressing home button and lock button at same time
3>Push your code to device and it will work, if this doesnt work then creat ipa file and install using itunes after resetting the device and it will show the new launch images
The answer by Steve still holds as of iOS 13.2.3, but I wanted to add a few more items just to back up this point that otherwise exceed the restrictions of a comment.
For starters, I did delete the app, restart the device, etc but because this issue occurs when a user updates through the app store, those fixes are simply not viable.
Then, I decided to take more drastic actions within the app to try and remedy this. These actions were taken with TestFlight builds.
In my particular case, the problem stems from a version string that misrepresents the installed version.
Step 1 then was to simply remove the UILabel in question. Re-running the app would still cause the label to appear in the app.
Step 2 then was to create an entirely new LaunchScreen storyboard and set it as seen here:
Launching the app still presents the old launch screen.
This leads me to believe that something in the project structure is the source of the caching, and no reasonable changes to the LaunchScreen by the developer are going to get around this.
Update
The app has been released to the Appstore, and using the official store release, the app presents the correct launch screen.
Solution
Again, thanks to the thread I have referenced above I found a way to solve this issue - name your new image differently from the one there was before in case your new one has the same name as the old one and put it out of the *.xcassets folder to the project directory and reference it in your UIImageView. And that's it.
Just delete app from simulated iPhone home screen.
On iPhone 11 Max version 2-finger click and drag up from outer margin of the iPhone which will bring you to the home screen and exit your simulated app.
Then 2-finger click and hold your app, delete app and close simulator.
Open Xcode and click play button to run your simulation and the launch screen should be updated.
P.S. Deleting Xcode cache and derived data couldn't hurt.
See Rambo's post about the issue. At least on iOS 13 you can clear this cache yourself:
import UIKit
public extension UIApplication {
func clearLaunchScreenCache() {
do {
try FileManager.default.removeItem(atPath: NSHomeDirectory()+"/Library/SplashBoard")
} catch {
print("Failed to delete launch screen cache: \(error)")
}
}
}
I am making a test sprite kit game, and when I run it on the device, the splash screen doesn't show up although it does work on the simulator.
Here are some screenshots:
Normally I set the target to iOS 7.1 and later, so I use a .xib file and LaunchImage file in xcassets.
I have put 2 correctly sized splash screens in the iPhone portrait iOS 7&8 section, and have selected "Portrait" under iOS 7 and later. The link from the settings file is definitely going to the correct file.
When I run it on the simulator (presumably all devices are iOS 8), the .xib file is used and it displays that splash screen.
When I run it on my iPhone 4, it displays a black screen. In my other apps, it would choose the image from xcassets and display it, but this is not the case.
Does anyone know how I could solve this problem?
Edit
Basically, I have put 4 images into xcassets for a splash screen. I have selected iPhone portrait for iOS 7 and iOS 8.
In the settings pane I deleted the launch screen file reference, so the only reference is to the xcassets launch image (It points to the correct place). I have also deleted the LaunchScreen.xib file.
But when I run the app on the device and the simulator, no splash screen shows up.
I faced similar issue and fixed by Restarting the Mac and iPhone
Uninstalling the app from Simulator/ iPhone helped to fix this issue.
I was having the same problem, and I finally figured out a solution. I want my launch screen to show up on ALL devices capable of running iOS 7 or later, when running my landscape-only Sprite Kit game. Most devices that run iOS 7 can be upgraded to iOS 8 or greater, except for the iPhone 4 (which is stuck with iOS 7.1), and the launch screen wasn't appearing on my iPhone 4 test device. Then I stumbled across Apple Tech Note TN2244. As described in the Tech Note, once you edit the info.plist to enable landscape orientation for iOS 7.0+ iPhone launch images, the correct launch image will appear. As a side note, if you disable the launch image asset catalogs as suggested, the XCode Swift compiler gives you warning messages -- but you don't really need to disable launch image asset catalogs, and if you configure them properly the warnings will disappear and landscape launch images will now work just fine on all devices, including iPhone 4.
Your app's launch image is displayed as soon as your launch your app. Hence the name. It is removed when the appDelegate appDidFinishLaunching: method runs. If you are app has very little to load, your image might get displayed and removed before you have time to see it.
If you want to manually set a longer display time for your launch image, you can add this code to the appDidFinishLaunching: in the appDelegate.m file:
sleep(4);
4 being the number of seconds.
I'd like to re-enable the letterbox mode on the iPhone 5 for my app. Using Xcode 4.5.2 and building an app for iPhone 5, I generated an 1136x640 launch image and it was named Default-568h#2x.png. I have sinced removed the launch screen and in the project summary the space for that image is empty. Also, I have removed any instances I found within the project folder. However, my app continues to be displayed using the full screen on the iPhone 5 and what I want is to be able to use the letterbox mode again. I believe this can be accomplished by deleting the app, but how can I re-enable the letterbox mode using the iPhone 5 and Xcode 4.5.2 without deleting the app from the phone?
Tap 'Product'->'Clean' in Xcode and remove the application from your phone. Then rebuild your project and there shouldn't be any cached version of the Default-568h#2x.png anywhere.
Have you tried deleting the app from the device and redeploying it? I have had issues with icon files etc not being refreshed unless the app is removed and freshly deployed.
Alternatively you can connect your iPhone and open organiser. Select the device and app and hit 'Download'.
Then add the archive you just saved back to your project. Then go to the Project Scheme Drop Down Edit Schemes>Run and select the app data package.
Redeploy your app from scratch and it will contain the saved state.
I had the same problem.
I disconnected my iPhone, removed the App from the iPhone's installed Apps, did a Project Clean in XCode, reconnected the iPhone and did a full build and redeploy to the iPhone.
Success! Letterboxing!