Xcode not building app with changes incorporated - iphone

After upgrading to Lion, Xcode 4.1 is no longer building my iOS apps with the latest changes incorporated (i.e code, bundle name, icon changes).
Before the upgrade, when I was using Snow Leopard, no matter what the change, or even if I replaced a file outside of Xcode with Finder or used an external text editor, Xcode would always build a fresh copy with all of the changes incorporated, without having to do any extra steps.
Now, Xcode seems to insist on using a previous version, and the only way I can be sure that it will build with all of the changes incorporated is do a Product > Clean from the main menu and then restart Xcode.
What's going on here? Is there a simple setting that I am missing? I never had to anything except click Run when I was on Snow Leopard, and all changes were always incorporated without a glitch. If I can't fix this I am going to revert to Snow Leopard.

Delete the "Build" folder in your app's folder on your computer and try running the app again. That should fix it.

Lion is known to have this issues with Xcode. I solved this by installing the newest beta available. If you don't have access to the newest beta try uninstalling and reinstalling. To uniinstall:
sudo /Developer/Library/uninstall-devtools --mode=all

Go the folder
/Users/%yourusername%/Library/Developer/Xcode/DerivedData/%yourworkplacename%/Build/Intermediates/
delete the projects that you want them to rebuild.
It works for me to make the modified file take in effect after I run it.

I faced same problem and I solved this.
On creating build and after installation of app if you don't get the changes that you made in it, means '.app' was not updated properly.
To fix this problem:->
First delete '.app' from project in Product folder and then make
archive (Xcode-> Menu Bar-> Product-> Archive, we dont do any thing of
this archive, Now close that organizer window)
Now clean your project and then make build by taping build option.
Now build is updated with your latest work.

I've experienced plenty of issues with taking "old" projects into newer versions of Xcode. If it's not TOO painful, I'd make a new project and just add all your classes and resources to it to make sure it's fresh for Xcode. This isn't trivial in some cases, but it's more likely to fix your issue.

Had a similar effect where every change appeared to be ignored, Xcode said it compiled but the simulator showed a previous version. Even when I did a clean and rebuild.
The problem was in the simulator, I noticed 2 icons of the same project. I uninstalled them both in the emulator and run it again, this time correctly with all my changes.
Guess the problem appeared because of changes in the name of the project bundle, this must have confused the simulator. so deleting the apps in the simulator did the trick.

Related

xcode continues project loading forever

I have a source code of a swift application which developed for iOS using swift 3.
I want to run it inside Xcode however it remains in loading state forever.
I have tried solutions provided in question Xcode freezes on startup while loading project however the situation did not change.
The developer of this source code told me that he used Xcode 9.x to develop application so he suggested me to try a 9.x version of Xcode. I guess Xcode should be backward compatible however I want to know does using Xcode 9.x changes the situation or I should look for reason somewhere else?
Using answer in apple.stackexchange.com did the trick:
Removing the ~/Library/Saved Application
State/com.apple.dt.Xcode.savedState/directory might help.
I tried all the solutions outlined here and none of them worked. However, I managed to fix this issue and here is what worked for me: If you're on an Apple OS and have iCloud sync enabled on your desktop/documents/any folder where you're loading Xcode from, the iCloud sync could be causing this issue.
I installed a fresh copy of my RN project in a directory not synced by iCloud and subsequently the issue was resolved; my build-time was down to a couple of seconds!
rm -rf ~/Library/Developer/xcode
in terminal worked for me, based on this answer
As of July, 2022, nothing else worked for me but, taking my project outside of the iCloud Drive and putting it into a directory without it. As it is mentioned above, iCloud sync interferes with the XCode running and stalls it.
I wasted almost 2 hrs and tried everything on stack over flow
SIMPLE SOLUTION
Just turn OFF icloud from your mac os so that it it will not sync the project.
To turn off icloud
Go to setting
Icloud
turn off sync
Thats all enjoy
I tried to delete:
~/Library/Developer/Caches/com.apple.dt.Xcode
~/Library/Developer/Xcode/DerivedData
~/Library/Developer/Saved Application State/com.apple.dt.Xcode.savedState
~/workspace/MyProject.xcodeproj/project.xcworkspace/xcuserdata
and once it helped. But another time it didn't help, so I also tried to reinstall Xcode, which also didn't help.
It turned out that the problem was that I was installing the app via WiFi or Bluetooth. When I connected my device via cable, the Xcode popped up to life and the "loading forever" stopped.
My xcode got hang when I force quit it. After that it was showing only "loading".
Here is fix to start xcode from beginning.
cd /
cd Applications
cd Xcode.app
cd Contents/MacOS
sudo ./Xcode
it will open xcode default window to open a new project.

Missing simulators in xcode 9.4.1

I am currently running 2 versions of xcode. I recently upgraded from
9.3 to 9.4.1 and also xcode 10 beta 6 on High Sierra v.10.13.6. The
simulators seem to work fine in xcode 10 beta 6 but are completely
missing from 9.4.1 I have downloaded and installed additional
simulators which show up in the simulators window list, however they
are not added to the drop downs in the main project window and the devices list remains empty. I wondered
if its simply that I have messed up something in the installation. I
have tried to remove everything and reinstall and got the same problem.
Any advice would be great. If anyone who is also running two versions could recommend
also optimum set up with installation etc. I can
post more detail as required. I have added screen shots please follow
the links.
[main nav - generic iOS device][1]
[empty devices panel][2]
[simulators panel][3]
[1]: https://i.stack.imgur.com/4qU4M.png
[2]: https://i.stack.imgur.com/SVLo0.png
[3]: https://i.stack.imgur.com/vavl1.png
I had a similar issue. If I created a new account on the same system that new account did not have the same issues. This lead me to believe it was a user preferences issue.
Some of the advice for fixing this involves deleting all Xcode files and re-installing from scratch. Try the solution below to see if it works for you since it’s much faster and less work.
Quit any running version of Xcode
Delete the folder: ~/Library/Developer/CoreSimulator
You can see from the attached screen shot there is a device_set.plist file. Deleting this file alone doesn’t help so delete the entire directory it’s inside of.
Launch Xcode
Select Preferences and go to the “Components” tab.
Download ANY new simulator
Once downloaded you should see all of your simulators showing up. It seems to be the process of downloading a new simulator rebuilds the list of installed simulators.
Note I tried downloading a new simulator w/out throwing away the above directory to see if this would rebuild the list of simulators but it did not work.

Xcode 9.4 not showing unit tests

I've a project that uses Swift 4.1, Cocoapods and has some unit tests. These tests were visible on Xcode 9.3, after I updated it to Xcode 9.4 the test navigator gets stuck and even deleting the derived folder, cleaning the project, reinstalling the software and restarting the Mac does not solve this issue. Must be a misconfiguration on the project (but I didn't change anything).
Any idea what I can do?
(Image has been resized)
Managed to solve the issue:
Simply uninstall all entries of Xcode following this answer this answer and install Xcode 9.4 again.
I came across this issue with Xcode 10.2.1 and solved it by making sure all my code was checked in and pushed, then creating a new sandbox (I'm using git).
That was easier than trying to figure out what Xcode files were causing the issue.
Check if you have disabled xcode indexing. if you have delete it using the terminal command
defaults delete com.apple.dt.Xcode IDEIndexDisable
Then restart your xcode. It worked for me.

Default#2x.png not showing only on AppStore version

I've tried Debug & Release & Distribution and even tested on device, and it seems that the Default#2x.png all show up then. However, if I do a clean install from the App Store, it shows Default.png.
I've also tried cleaning it several times, rebuilding, deleting and putting Default#2x.png, but the same bug still occurs. I even wrote in the review notes for Apple to check but they didn't reply (I guess they missed out on it). What's happening here?
Thank you.
Have you accidentally removed it from your target at any point? Right-click on it, select Get Info, and check your target is ticked. If it isn't, then it doesn't get copied into your app bundle.
This kind of problem doesn't show up right away during development because when you install a development build over the USB cable, existing bundle files are not removed. So if at any point it was correct, then the file would have been copied across to your device and remained there. You can check this by deleting the app from your device, then reinstalling a fresh build. If it stops showing up, then your file is not being found.
You can also check to see if a file is part of your application bundle by right-clicking on it and selecting "Show package contents".

iPhone: There is no SDK with the name or path 'iphoneos3.0'

A friend of mine just had to reinstall his OS (after power went down while updating) and when he installed Xcode he got this error. In the drop down that usually has device/simulator etc, it said 'missing'. I also noticed he had no developer folder on his machine as well. Anyone know why this might be?
Tell me about it. Try this
in XCode goto 'Project' Menu and select 'Edit Project Settings'. In the General tab, last but one item, select the drop down list 'Base SDK for all Configuration' There you can specify which SDK your project will target.
I had this problem after installing the Xcode that comes with Snow Leopard. To solve it I downloaded Xcode for iPhone. The Xcode that comes with Snow Leopard does not include the iPhone SDK.You have to be a registered iPhone developed to use it.
I had him reinstall it with me there, and I noticed that the action for the developer tools, was install as opposed to upgrade, and it was grayed out so not sure how he would have been able to avoid that. In any event he reinstalled and got the same error when launching from the dock. He then launched from terminal and it worked fine... so somehow he got two installs or some weird scenario. In any event we found the .app that spotlight saw and put it on the dock and then it worked.
The system does not include the dev tools (and hence the /Developer folder) by default. He needs to re-install the dev-tools from his CD (or from developer.apple.com), and also re-install the iPhone SDK (only available on developer.apple.com).
EDIT: I didn't see he re-installed XCode. Sounds weird. Make sure you re-install everything, and that you have the correct rights. However, is no issue is found by the installer and you still don't have a /Developer directoty, there might be something weird going on...
After Xcode updated to Version 11.6 got this error.
error: There is no SDK with the name or path '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk'
Looks like iPhoneSimulator13.5.sdk got removed.
Fix by downloading "iOS 13.5 Simulator"
In Xcode -> Preferences -> Components downloaded iOS 13.5 Simulator again.