iOS simulator issue - ios

I downloaded xcode 4 and created a single view application with storyboard.
I added two views to the segue and tied them back to the home screen. After that I must have done something weird. The only thing I can think of is that I put the iOS simulator on the dock. I've updated the project and the changes are not being reflected on the simulator.
What I think is the issue is that I have two iOS simulators on the computer. For some reason whenever I try to find one in spotlight or in the applications it only shows one. When I click on it it is the old iOS simulator from Xcode 3. So what I did was I looked at stackoverflow and it suggested cleaning and running the project. That did not work.
After that I looked harder and found that I should reset content and settings on my new iOS simulator. That's what I did and now when I build and run it it is saying that it can't find my storyboard.

Generally you don't run simulator separately, but let Xcode fire it up for you. So, in Xcode, in the upper left corner you can select your scheme (and you select whether you want it on the simulator or the device). You can then select the simulator and then press the "Run" button and it should fire up the simulator for you. No need to fire the simulator up separately.
If Xcode is not behaving well (i.e. there are no error messages but the simulator never comes up automatically when you tell Xcode to run it on you simulator), I'd suggest (a) quitting and restarting Xcode (sometimes it gets in a weird state); (b) cleaning your project; and (c) try running it again.
In terms of not finding the simulator in Spotlight, it's now part of the Xcode.app bundle, so Spotlight won't find it. But if you want to dock it (not sure why, but feel free), just fire it up from Xcode by running an app on the simulator and when it appears in your dock, control-click on it and select "Options > Keep in Dock".

Related

Why does my swift project look different on my device vs. the simulator?

I am working on a xcode project and when I run the app on the simulator everything looks as it should but when I run it on my real device (iphone 7) the changes I made in the storyboard are not applied.
I changed the text on the tab bar on one of the tabs from "kort" to "favoritter" and on the simulator this applies but on my device the text is still "kort" as before.
I have tried to delete the app from my device and clean the build from xcode and then install it again but it did not help.
Does anyone know why this is happening and how to fix it?

iOS launch screen does not update

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)")
}
}
}

Xcode 7.2.1 only shows 'Generic Device' when I want to run my app, instead of the list of iPhones and iPads

I am a beginner in Xcode and I just updated it to 7.2.1. Before I did this I never had a problem with running my app, but now it only shows me 'Generic Device', instead of the regular simulators I use. Anyone know how I can solve this?
Sure, you can add any simulator you like. Just open Xcode and under the "Window" menu, click "Devices".
Then, you can click the little plus in the lower left to add a Simulator.
Just select the one you want, and name it, and you should be all set!
You may also need to actually download the simulators, if for some reason they're no longer on your computer. Go to the Xcode preferences, and then in the downloads tab you'll see simulators listed.

App will not show first view on device (does not crash either), but works perfectly in simulator. Also loads different icon for device

I have a program that recently just started not working in the device, but works perfectly in the simulator. There is no crash or errors, but when using the device, it will not load the first view. I have a movie that I run in the beginning, and that runs fine on both simulator and device, but then simulator will bring up the first view and device will not. Black screen.
The other odd thing is that the icon for the app is different on the device than the one on the simulator. The one on the simulator is the correct icon for the app. I did review others with a similar issue, but everything I found revolved around errors and crashing, which mine is not.
Any help would be appreciated.
One thing you need to watch for is misnamed image files. By that, I mean uppercase, lowercase issues. The simulator can't tell the difference between yourpic.png and YourPic.png, but the real devices can. They will not display art that is misnamed, even though it works fine on the simulator.
You likely have other issues, but you should at least check this one.
It sounds like some files are missing from your project. They exist in your directories on your computer, so everything runs fine in simulator, but they are not being copied to your device. Check the list of files on the left side of XCode, especially your Resources directory.
You can also check in your build process. Click the target (that's your top level group in your file navigator at the left of XCode). Click the Build Phases tab. Expand "Copy Bundle Resources". Make sure that there aren't any files you need missing from there.

Xcode 4.3.2, issue with running on simulator

I have been having this weird problem with Xcode 4.3.2, of course after the recent update.
After successfully building and running on the simulator several times, xcode seems to not be able to connect to the simulator and can't even stop the project; it's like the simulator does not exist. I have tried:
Stopping the project – doesn't work.
Quitting the simulator – doesn't work, xcode still shows it's running on the simulator even when I quit the simulator.
Cleaning the project – doesn't work.
I have to force quit xcode to get it communicate with the simulator. Nothing else works. It gets quite frustrating to do it every half an hour. This only started with 4.3.2.
I always stop before building and running, so it is not an issue of simulator/xcode getting thrashed by me.
Any suggestions?
I have found by chance, it is not a solution by any means -
When xcode hangs, saying it is running the app, but nothing is on simulator, opening the simulator from the dock by clicking on the dock icon (not using command+tab) seems to work.
It is very weird,but it works; atelast till xcode fixes it.
I had the same damn issue on XCode 4.5.1, but I resolved it just now.
When the program is running, it gets compiled but doesn't show anything on the simulator. just click on iOS Simulator icon in dock in order to bring it to front. Click iOS Simulator on top left -> Reset content and settings -> then force quit the iOS Simulator and run the program again. !!
Besides a restart, there is one other way I've managed to get around this:
Let's say your app hangs, go to the targets selector in the top of the Xcode window and change your sim target to a new SDK (or if you don't have another SDK, change it to a universal app and run on the opposite device simulator).
Then, when your app loads on the new device/OS completely, quit the sim, change your targets back, et voilà!
Uninstall application from Simulator and again run. Then it will works fine :)
This has frustrated me for -years- now but stumbled across what appears to get things going again for me:
Hide the simulator (iOS Simulator -> Hide iOS Simulator) or Cmd-H, then reopen the simulator.
The problem seems to happen when something CPU intensive is happening in the background (like a Time Machine backup) on my old 2 core MacBook.
Xcode 4.6.3 update (June 13, 2013) resolves the following issue:
Hang when debugging in iOS Simulator on OS X 10.8.4. 13722320
https://developer.apple.com/library/mac/#releasenotes/DeveloperTools/RN-Xcode/
You can try to update your Xcode to see if that works for you..

Resources