When I click on a folder in the Navigation pane, and open it in Finder, the file is there, but it's not shown in Xcode and build fails complaining the file doesn't exist. Is there a way to "Refresh" the file structure (the way you would in IntelliJ) or can I only do a drag*drop to fix it?
When I click on a folder in the Navigation pane, and open it in Finder, the file is there, but it's not shown in Xcode and build fails complaining the file doesn't exist.
The project navigator doesn't show you the file system, it shows you the files included in the project. If you need to include a file in the project, then you'll need to add it. You can do that by dragging it into the project, or with the File->Add Files To "..." menu command.
Related
Just downloaded Xcode 10.1. I have Preferences->Navigation->Double Click Navigation set to 'Uses Seperate Window' as I usually do. However double clicking any file in the project opens a window but the contents of that window is the wrong file. Whichever file I double click on, the same incorrect file opens. If I change double clicking to open in a tab, the correct file is opened...
The problem appears to be just one project.
Have tried a 'Clean Build Folder' to no avail
It was working fine in 10.0
I open the project using the xxxx.xcworkspace (as I have pods in the project).
If I open a new window and view a specific file there then go back to my window with the list of files and double click that file, the correct window is brought to the front with the correct file visible.
Same here. For me it's the Readme.md file that is added at the top level of the project (not inside a group). Removing the reference from the project or putting the top level file(s) in a group (folder) fixed the issue.
Somehow my storyboard file won't load in my Xcode project. I see the storyboard in the app project from finder, but when I open the Xcode project it's missing and it's red. I tried dragging the file in but it wouldn't show up in Xcode. What's wrong?
Sounds like your directory structure changed without updating the pbxproj file so the filepath is broken. Click on each affect file, open the Utilities pane to the File Inspector, click on the folder icon and select the file in the Finder window that comes up to restore the path.
I tried to rearrange my source code files in finder and now xcode shows them as deleted. Is there a way to tell xcode the new location of the file?
Click on the Missing file (turns Red) and go to file inspector. Click on the folder button in file inspector and provide the correct path of the file.
For missing files like this in red.
set correct path as shown below.
Select the file in the left (navigator) panel. In Xcode open the right (Utilities) panel if it's not already open. Now click the "File Inspector" tab. You should see a part that says "Location" with a button that looks like a folder. Click that button and then navigate to the folder where you moved the files to. Bam! Xcode should now see it's there!
So if I go into my selected save folder for my projects and delete my project it no longer shows up in Xcode. However I can still find some other files if I look under my user name/Library/Developer/Xcode/DerivedData. There are other files Xcode creates and I'm afraid if I make, and delete a bunch of projects, it is just gonna clutter my Mac with a mess of unneeded files. So how do I completely remove a project in Xcode?
Appreciate the help.
Xcode 9
In Finder, delete the project folder. (If you don't know where it is, open the project in Xcode and right click on project name in the Project Navigator. Choose Show in Finder.)
In Xcode, remove the deleted project from the menu. (Go to File > Open Recent > Clear Menu. This will clear all of your recent projects from this menu and the startup menu.)
For Xcode projects in version 11:
Open Xcode
Click on File
Open recent: Clear menu
It will remove all the projects that you have on your Xcode.
For Xcode 4, you can go to the Organizer by clicking the button at the top right, and then you'll see your projects. Right click the one you want to remove, and choose "Remove from Organizer..." This will remove all the associated data. I don't know if this is an option in previous versions of Xcode.
Solution for Xcode 7.3
To delete Xcode project:
Locate the project directory in finder, right-click, and select Move to Trash
To delete Xcode project data:
(From the Xcode welcome screen) Go to Window > Projects, select the project, then click Delete next to the derived data and/or snapshots
Note: deleting project data can free 50+ MB even from simple projects!
The easiest way I found to do this in Xcode 9.1 was to open Xcode (which may "open" only as an icon on the dock if there are no current projects) and select 'Window' from the Xcode application menu.
Select the 'Welcome to Xcode' option, then click on 'Open another project...' in the right pane of the window. This should take you to the root of your projects folder in a Finder window. (Mine end up in /Applications by default.) From there you should be able to select the project name and 'Move to Trash'. Empty your trash to get rid of it entirely.
Physical deletion : Go to where project folder is. Simply delete folder
By default it is Documents/[Project name]
To remove as start-up choice list :
On Terminal: open /Applications/Xcode.app
Then
File -> Open Recent -> Clear Menu
Cheers
/Users/User/Library/Developer/Xcode/DerivedData/ProjectName-UI
this is the build folder for your project. You can delete it in finder or in Xcode by pressing Command-Option-Shift-K before delete the project itself.
For Xcode Version 8.2 (8C38), you can remove the projects completely (project name in Xcode, programs, data, etc.) one by one by doing the following: [Note: the instructions are not for just remove the project names from the Welcome Window]
Launch the Xocde and wait until the Welcome window is displayed. The projects will be shown on the right hand side (see below)
Xcode Welcome Window
Right click the project you want to remove completely and a pop window [Show in Folder] jumps out; selec it to find out where is the project in the [Finder] (see below)
Find the project folder
Right click the project folder in the Finder to find it’s path through [Get Info]; use path in the Info window to go to the parent folder, and go to there[Locate the project folder path][3]
Right click the Project Folder (e.g. DemoProject01) and Porject file (DemoProject01.xcodeproj) and select [Move to Trash] ; you will see that (a) the folder in finder is removed AND (b) the Project in the Xcode Welcome Window’s Project List is removed.
To Delete XCode Projects in Ver.7.3 you must:
Open up the Project you would like to delete
Select the 'Window' option from the Active App Menu for Mac programs. The one where you find - File, Edit, View etc..
Select the Projects option
Then you will see a full list of projects
Highlight the ones you want to remove - Shift + Click >>> Click
Then Right Click and Select Remove projects
I renamed my project and it's files and now Xcode is still looking for the old info.plist file. Where do I set the locations of the .plist and .pch files that it needs.
In my Project Info window, under Packaging there's an item for Info.Plist file, but it was blank, and when I try different paths, nothing happens. On compile it still says it can't find the plist by the old name.
I know this answer is answered and closed, but I'm going to add my discoveries here as it is slightly different for Xcode 4.2:
Select your project
In the left side of the middle pane, select your app under "Targets"
Select the tab "Build Settings"
Search the following keywords: "info.plist" and "pch"
At this point it should be pretty clear which are the ones you need to modify.
Click on "Validate Settings" and you're done.
Found it.
It was in the settings for the Target.
Choose Target in the Groups and Files pane on the left.
Right-Click and choose Get Info
Search for "Info.Plist" and type in the filename for the correct plist file into the property of the item named "Info.Plist File".
Then search for "Prefix" and find the item named "Prefix Header".
Change it's property to the name of the correct .pch file that you are using.
I think these different "Info" windows are confusing. You have to make sure the right file is selected in the Groups and Files pane before selecting "Get Info", and it's hard to tell if what you're doing is actually making changes to the Info.plist file, or where your changes are being saved.
For Xcode 10.1 when rename or move info.plist to sub folder.
Select your project
Choose targets
In General tab under Indentity you can specify new info.plist file
One more wrinkle to this. It still would not find the new plist file because it was in a folder inside the main project hierarchy on my disk. In this case, the name you should put in the build settings is relative to the project file, like "FolderName/Info.plist" for example.
Just close project and reopen it. Then you will see on the project target, choose plist button on the General tab See this screenshot to make sense
From XCode 11 onwards, the updated path for Info.plist has to be changed under Target -> Build Settings -> Packaging -> Info.plist File.
Please read here for further details
I know this is an old post, but I just ran into this same problem using Xcode 8.2. I had already duplicated .plist and .storyboard files in finder, but my Xcode project did not pick them up. In order to add files to your xcodeproj just right click on the project or folder in the Project Navigator and select Add Files to "Your Project Name". You should be able to select the files you need (use Cmd key to select multiple individual files).
If you created a new .plist or .storyboard file you'll need to link to your target membership. To link just click on the file in the navigator and on the right hand side in your standard editor > file inspector > target membership select the appropriate target membership.
The correct way to do this without duplicating files in finder is by selecting the file to duplicate and then going to File > Duplicate on the Xcode navigation menu.
I am working with Xcode 9.3 and "boldly" changed my app name without understanding that I was inviting trouble: I got it.
Fortunately, it is now easy to rename a project or app with reliable results if in Xcode you select the blue icon on the left/in the project navigator and then edit the "Identity and Type" "Name" field in the "File Inspector". This brings up a dialog, and clicking on "Rename" works reliably.
Xcode 14
Chose your Targets -> Build Settings -> Packaging
Find key "info.plist File" and update path like "AppName/FolderName/Info.plist"
enter image description here