Removing test target completely from Xcode project - ios

I tried to remove test target from Xcode project so I followed suggestions from this Stackoverflow post.
Then I deleted AppnameTests folder with files in it (AppnameTest.m and info.plist) by right-clicking and choosing move to trash. Also tried Xcode->Edit->Delete for deletion.
After that, I tried to clean project, but one weird thing is happening. Folder AppnameTests is not removed after deleting that folder trough Xcode (files inside it are gone). It can be removed only manually using Finder, but I don't think this is a good idea, because maybe Xcode keeps reference to this folder.
I am using Xcode 6.1. Anybody experienced this? Why is this happening?
EDIT:
Here is what I see in finder after deleting (yellow) folder called AppnameTest using Xcode's delete command:
The folder itself from filesystem is not removed.

In Xcode, if the folder 'AppnameTests' is yellow, it is not a folder, it is a group. If it is blue, it is a real reference to a real folder.
In general, just after creating a new project in Xcode, this folder is yellow, and s it is not a folder, but a group that is a link to a folder (group has not necessary a corresponding folder in the Finder).
You can remove this folder by hand in Xcode (I do it regularly).

Related

Files are not in project navigator eventhough project compiles and can search for them

The problem started when I got into the project and saw I have no scheme. Couldn't create new scheme except for the cocoa-pods target. Then I went into my project via finder, and noticed that the project was backedup into the iCloud, and when downloaded it it appeared in the schemes and ran fine.
So I am with this project for a while now, started it in xcode 9 and already released a few versions to the store. Today I open the project for more developing, and I notice that I cannot see the files in the navigator. If I search for them I can go into them and edit. If I am running it, it builds and runs perfectly. Only problem is that I cannot navigate between files, and cannot find the storyboard in the search, so cannot open it at all.
I tried -
Hard clean
Delete derived data
reset computer and xcode.
But still cannot see the files in navigator.
Screen shot of navigator added:
As per our discussion in comments above I am adding the comment as answer, you can try deleting the xcuserdata folder inside .xcodeproj and re-run the pod install to solve the problem.
In order to do that, go to your .xcodeproj right click and select show package contents
Once it opens the finder window with contents inside it, simply delete the xcuserdata folder
Now get back to your project root folder in terminal and run pod install once done open the project using workspace.
That should solve your problem :)
Happy coding:)

Xcode won't remove Derived Files

I need to figure out why it is that Xcode, suddenly and with no provocation, starts handing me this error and not allowing me to build my project. When I say, "without provocation", I mean I'm editing text in the database the app delivers text from, and checking my progress in the simulator, doing nothing in Xcode at all except cleaning, building and testing. Everything will be fine for several test sequences, then suddenly, changing nothing in my procedures, the app won't build and I get these errors:
error: remove
/Users/casey-cayce/Library/Developer/Xcode/DerivedData/PEM-LTE-2016-gyoajgqmkkoluhgbrhjmgwakiejl/Build/Products/Debug-iphonesimulator/Living
the Eucharist.app/images: Directory not empty
error: couldn't remove
'/Users/casey-cayce/Library/Developer/Xcode/DerivedData/PEM-LTE-2016-gyoajgqmkkoluhgbrhjmgwakiejl/Build/Products/Debug-iphonesimulator/Living
the Eucharist.app/images' after command failed: Directory not empty
I've gone to this Derived Data folder and physically deleted the contents, only to have Xcode restore those contents when I reopen the app, fail the build, then give me the same errors over again. My only solution so far is to completely delete Xcode and the Developer folder, reinstall Xcode, after which it behaves fora little while, but will eventually do the same thing again. I've done this 3 times so far today.
If anyone has any suggestions, please help me get this resolved so I can get this project exported and finished.
Thanks.
Additional info in response to responses:
I have:
1: Closed the project.
2: Opened the Projects, folder and deleted the Derived Data, seen the Projects folder go blank (empty) with "No Projects" showing in the window.
3: Made sure the trash is emptied.
4: Run "WatchDog," an app developed specifically for dealing with Derived Data issues in XCode.
5: Closed Xcode & re-opened.
6: Opened the project, cleaned, and run the Build command.
After all that, the same errors come up again.
Check your "Copy Bundle Resources" in Build Phase, You should find some files(should be images in your situation) in that list twice. Delete them and rebuild.
It is ok to delete DerivedData folder, you can delete all files from DerivedData sub-folder (Not DerivedData Folder) directly.
That should not take any effect. Contents of DerivedData folder is generated during the build time and you can delete them if you want. It's not a issue.
All contents of DerivedData will be recreated when you build your projects again.
I suggest you clean project project and build again, ALSO PLEAE MAKE SURE YOUR DELETED DerivedData folder is not in BIN please clean trash, it is important
In Xcode go to Window > Projects, select your project and there will be the delete button to delete the derived data.
As of Xcode 9/10 you'll be able to access the Derived Data folder by navigating to
File -> Project Settings
or if you use a Workspace:
File -> Workspace Settings
And press the arrow behind the path:
Go to the folder and delete the derived data
Add this to your shell and it will remove the DerivedData
rm -rf ~/Library/Developer/Xcode/DerivedData/*
It's not the best option, but helps me a lot of times - create new project and drag all source files from current in to new one.

What file to update in an XCode project when some folders names are updated?

I have changed the name of two folders of an XCode project and when I open this project, it doesn't work anymore (XCode can't find the files where the name of the folders were changed). I know it's a little issue and I have tried to find where to update the references to these particular folders in XCode but couldn't find how to.
I have changed where it is written "NewName"
Can you help me to solve that ?
Thanks
Blue Folders in Xcode are physical folders on disk in the project folder.
Navigate to the project folder in Finder by right-clicking on a valid item in the side bar > Show in Finder, quit Xcode, rename the folders in Finder accordingly and reopen the project.
Then check the Build Settings of the target if there are any path references using the old folder names and change them, too.

App falsely reports missing file

I downloaded a git hub project, a screen recorder(ios). It said I had to also copy in Inappsettingskit, so I did. So I tried to run it on my iPod and it told me that IASKAppSettingsViewController.h and .m were missing, even though I checked, and they are there, in the correct folder.
All the files are there in the correct place. The only thing I am noticing is that the files are in red text in Xcode:
Sorry that I am such a noob. Any ideas on why these errors show up?
Just guessing here, but chances are something went wrong when you added the files to the project. Try this.-
Remove the files references from Project navigator
From finder, make sure the physical files are inside your project folder.
Drag the files from finder to Project navigator. Uncheck copy items into destination
Drag the recently added files from Project navigator to Build phases => Compile sources section

I deleted a folder out of my xcode project by mistake, where does it go to?

I deleted it out of the folder view in the left sidebar. It's gone from inside the apps folder and it isn't in the trash. It isn't letting me undo inside xcode either. It's a phonegap project and I deleted the 'www' folder.
Normally, the folders in XCode do not represent real folders in your filesystem.
Did the folder contain certain files? Can you check if these files are still present in the root of your project folder (via finder)?
If yes, the simplest way would be to just create a new folder an drag the files into it again.
I hope you have a backup. Xcode 4 deletes the files directly, rather than moving them to the trash. Please, file a bug report about this at bugreport.apple.com!

Resources