I'm going nuts trying to do something very simple. I have a number of images in my app that are displayed at certain times. In the course of playing around with retina images, I delete the image files from my app. Except that when I ran the app in the Simulator, the images are still there. I checked the project folder in Finder, and the images are definitely gone. I've cleaned and rebuilt the app, but they're still displaying. If I build the app for the iPhone, they're not displayed. So how do I clean it up for the Simulator?
Thanks for any pointers
Try just deleting it from the simulator as you would on a normal iPhone, then running from XCode. If that doesn't work, quit the simluator and go to ${HOME}/Library/Application Support/iPhone Simulator/${OS_VERSION}/Applications. There will be folders for each application named after the application's id. Find the folder for your application and delete it. Then run again from XCode.
Related
I ran into this when I tried to deploy my app to the iOS simulator earlier today - the debugger never connected, and the iOS simulator crashed. Now I can't get the simulator to do anything.
When I first launch the simulator I get a black screen (no tiles from the dashboard), and pressing the home button makes it freeze. If I access the menus at the top of the screen in OSX, that works until I press the home button, then it freezes.
Things I've tried:
Creating a new project in Xamarin Studio and running that
Creating a new project in Xcode and running that
Opening up the Xcode package contents and running the simulator .app from there
Clearing the simulator's Content and Settings.
Reinstalling Xcode fresh (5.0.2)
Pressing the home button (or whatever it's called) on the simulator
I created a new profile on OSX and running the simulator from there, and it froze for a good 20 seconds, then all of a sudden I saw the tiles appear for the home page. I then switched back to my original OSX profile, still didn't work.
The problem seems to be something with my profile, but I have no idea what to look at next. Any thoughts?
GOT IT! The problem was a file located in /Library/Application Support/iPhone Simulator/
the iPhoneSimulator folder was missing - or it looked like it was a link to a missing folder. I deleted it, ran the simulator, and it was fixed.
I am developing a universal app. My deployment target is 5.1 I want it to run portrait-only on the iPhone/iPod, and in landscape-only on the iPad.
I am testing with the iPhone and iPad simulators, as well as the latest versions of the iPod touch and iPad.
It works as expected on the iPhone. The portrait launch image comes up first, then the app starts. No problems. It works fine on the simulator as well as my iPod. No matter what the rotation, the app starts and continues to run in portrait (bottom home button), which is as intended.
It works correctly in the iPad simulator. The landscape launch image comes up, then the app starts in landscape. Whatever the rotation, the launch image and the app start and run in landscape as expected.
However, on my iPad, the portrait launch image displays in portrait-upside-down, no matter which way the iPad is rotated. When I remove the Default-Portrait~ipad.png and Default-Portrait#2x~ipad.png files from my project, XCode replaces them with Default.png and Default#2x.png, which are for the iPhone--not the iPad, and which also launch upside down.
My InfoPlist includes these settings:
Initial interface orientation: Portrait (bottom home button)
(There is no key for Initial Interface orientation~ipad)
Supported interface orientations: Portrait (bottom home button)
Supported interface orientations~ipad:
Landscape (left home button)
Landscape (right home button)
I tried changing the Initial interface orientation to Landscape, and I tried removing that key altogether. Neither change made a difference in the way it ran.
I’ve now tried everything I can think of to make this work. Does anybody have a solution?
Thanks.
Okay, I finally fixed the problem. Seems like a bug in XCode to me, but I should have caught it.
I located all my image files in the "Supporting Files" folder. This was not a problem for my music files or most of my image files. However, when it came to my Default-Landscape~ipad.png and Default-Landscape#2x~ipad files, XCode did not like it.
I had dragged those files into their respective boxes on the Summary page, and they were accepted. Then I moved them from the top level folder to the "Supporting Files" folder--just like I had done with the Default.png and Default#2x.png files for the iPhone.
When I built the app, I got no errors. When I ran the app, I got no warnings.
However, HERE IS WHERE I WENT WRONG. I did not run the app with the Profiler until late in the game, and apparently even when I did, I must have ignored the two warnings. Finally, I noticed them: Icon specified in the Info.plist not found under the top level app wrapper: Default-Landscape~ipad.png. I had the same warning for Default-Landscape#2x~ipad.png.
So, I deleted those two files from my project. Then I dragged them into their respective boxes on the Summary page, just as I had done before. But this time I did not move the files from the top project folder. I ran a Clean. Then I ran the app.
IT'S FIXED.
Hope this helps somebody else. ;)
I had a similar issue and was able to fix this issue by changing the order of the supported orientations in the plist file to be [0]:LandscapeRight and [1]:LandscapeLeft
I'm using Xcode 4.3.1. Adding launch image is pretty simple -- just drag the image to the Project->Summary->Launch Images window.
So I set a launch image before and it worked. But when I dragged a different image and run the app on my iPhone again, the launch image still remain the same as the old one. Even after I delete the launch image from the Launch Images window, the old image still shows up upon launching.
I've tried clearing the build as well. Didn't work.
Help please. Very much appreciated!
I had the same issue, but with launch storyboard. I had to rename the image I've used as a background.
Deleting from the device didn't help with Xcode 4.5.1. The build process is caching the image. With a hint from Zorayr's answer to related question "Xcode, can't remove “Launch image” from project," I decided to track the cached image down and destroy it, so it wouldn't keep being built and showing up in my test App.
Eventually, I found that Xcode (at least 4.5) builds the images by default in the following path off your home directory:
~/Library/Developer/Xcode/DerivedData/<ProjectName>-<uniqueID>/Build/Products/<Scheme>-iphone{os,simulator}/<ProjectName>.app/
So in addition to removing the old App image from the device (or simulator,) you also need to remove the image file(s) from the build cache. But just doing something like
rm ~/Library/Developer/Xcode/DerivedData/MyProject-fpwnjlbayydgzxcdlyrwxrwntapr/Build/Products/Debug-iphoneos/MyProject.app/Default*.png
won't always solve your problem. Instead, you might get a strange error in a popup window saying something like "Signed product moved or deleted." (I can't reproduce it right now to get the exact text.) It doesn't show up in the log file, and it just hangs the build process (in Xcode 4.5.1.) To get around that, I deleted all of the files under the <ProjectName>.app/ directory tree and the sibling directory tree <ProjectName>.app.dSYM/ containing (seemingly) the symbol tables and signature files for the parallel products. The build process will then re-create everything with no more complaints.
What worked for me on iOS 10.2.1, iPhone 5s hardware test device, Xcode 8.2.1
I think it has nothing to do with Xcode. The test device appears to be caching the LaunchScreen.storyboard image. I needed to reboot my device by holding home + top button. Then I rebuilt, low and behold, the image updated.
You should delete the app from the device, then launch it again.
Quit the simulator and then run the project again.
For device, as mentioned in other answers, delete the app from the device and then run the app again.
Steps that worked for me in 2020 (xCode Version 11.4.1):
Delete derived data
Restart xCode
Delete app on device
Restart device
Clean rebuild and run
Except the last step, I think the order doesn't matter.
It's really annoying though and I'm not even sure if it always works.
Pretty pathetic on apple's side. Good luck guys!
If you were using an asset catalog, it can also help to delete the images from the Images.xcassets file, and then load them manually in General>Launch Images.
This is what worked for me
Put the new image in project folder
Run app on device/simulator
Put image in xcassets under a different name
Run app again and it works
I thought I would create an update for anyone who is XCode 10 (and possibly XCode 9) and experiencing a blank black or white screen after modifying a launch image.
In my case I had to create launch images for the iPhone XR, iPhone X, iPhone XS and iPhone XS Max.
Originally I just had a sample white launch image for testing. After creating my proper image for the XR and replacing the sample the change would simply never show (on the XR device). I would still get a white screen.
I tried all of these in combination and failed:
-deleting the app beforehand.
-deleting xcode derived data and cleaning the build.
-restart Xcode and the device and the computer.
-deleting any existence of the white launch image on the computer.
-manually editing the JSON in a new images asset with the correct file names
The XR device would continuously show a white screen and after meddling with the build setting and migrating back to image packs it turned to black.
Solution:
Ultimately it started working after I also replaced the white 'XS' launch image with a new one as well. Even though the device is an XR. This is an odd solution but solutions like this have helped with launch images throughout the years.
For me, quitting the Simulator and restarting it worked -- I can finally see the updated launch image. The note above from Emil Korngold triggered me to try this.
I am testing my app on SDK iOS Simulator to make sure it runs properly. First of all, I decided to remove a splash screen image because I don't think I want one. When I ran my app again, it's showing the splash image again, thought I was a bit confused there, so I deleted the image from references and removed the image from the folder, to the trash. WHen I ran my ap again, it's still showing the same splash screen image again! I have no clue what's going on with my project now that the stupid splash screen image that I removed kept showing over and over again. Then I tried to run other project to see they are ok, but for some problem again, that same splash screen image that I completely removed is still showing up! Hopefully someone can Please help me resolve this situation quickly!
Clean the project (in xcode :-) ), remove any installed version of your app on the simulator (if you want, reset the simulator, it will be more efficient), go into the finder and with a rightclick on your xcode project, open the package and check if there are no included source file into it (.m, .h, resources, ...), including your image. If there are, move them out and update the needed one into your project. Then clean your project again in xcode, build, run.
Does this work ?
in xcode you need to do a build clean, then delete the app from the simulator, then build and run.
See Xcode- Deleted images appear in simulator. You can also try removing the app from your simulator and running it again.
my app was working perfectly fine, until I cleaned the targets and deleted the app from iphone simulator.
It now compiles but ends itself as soon as it runs, with NSInternalInconsistency exception.
Trying NSLog only tells me that the error comes from the main function, which I didn't touch.
I think the error has to do with the modal view, but it was running perfectly until I removed the app on iphone simulator. Only, I changed some of the image file names from Resources folder right before I cleaned the targets... (but even so, it was running well before cleaning/deleting).
Has anyone had this experience where everything that has worked suddenly gives you an error after cleaning/removing? How did you deal with this?
Please help me out.
Only, I changed some of the image file names from Resources folder right before I cleaned the targets... (but even so, it was running well before cleaning/deleting).
it was running well because the renamed images weren't changed in the app on the simulator.
Files aren't deleted from the app bundle when you install your app with Xcode.
Clean All doesn't remove them, neither does the deletion of the build directory. Unless the app is removed from the simulator the old files are still available for the simulator.
Find the places where the old images are still referenced in your project.