Renaming xcode project giving issues - ios

I renamed my xcode (version 6.3) project and it worked fine, but as I shifted it to another machine, it didn't show any classes/ scheme. Even clicking on a new scheme is showing a "None" Target. See the screen shot.

Click on the left of the "My Mac" (where it usually says the name of the scheme), select Edit scheme, and on Run set the Executable to your APP_NAME.app

I resolved the issue by choosing the file inspector of .xcodeproj file and corrected the Location. It was picking some other location of any previous version. After that I created a new scheme and it works like a charm now!!

Related

XCode won't run my application on a device/simulator anymore

I am kind of stuck with my XCode problem. First of all: I have a project that contains 5 different targets. Now something went wrong (I can't remember changing anything related to project settings).
If I want to run any target on device or simulator the build succeeds but then nothing happens. Neither the app is started in simulator nor on a device. So I checked the Scheme (-> "Edit scheme") and I could not select my app in the Executable menu. I think I can remember that the .app file was selected there before (as it is if i create any new project). Does anyone know why I can't select anything there?
What I am curious about, is the fact that choosing "Other" in the Executable menu brings me to my DerivedData directory that indeed contains the *.app file resulting from the build. That leads me to my next problem.
If I select this *.app file explicitly and try to run the app XCode gives me the error " does not have an architecture that can execute." But I checked my settings many times and I am definitly using $(ARCHS_STANDARD) in every target.
I am a little bit lost here ... does anyone has a hint, what could have messed up my project and how to fix it?
Might not work, but I've found a lot of bugs in xcode which simply require quitting it, and reopening.
You could also try clearing out the DerivedData directory. Do a full clean build (hold down option key when selecting clean build).
And lastly, reset the simulator via the menu iOS Simulator > Reset Content and Settings.
I got this when I changed the name of my App on one development machine and then tried to work on it a few months later on another machine. I fixed it by deleting the old scheme and Autocreating the new scheme. The settings are under Product - Scheme - Manage Schemes.
OK I solved the problem by myself. I was on the right track before. I did compare the project.pbxproj file again using FileMerge. I merged all lines related to an *.app file from the working version into my corrupt project file. After that my project was fixed. The *.app files showed up under the "Product" group in XCode and I could run the application on simulator/devices again. It seems that I forgot something while I was merging the files via copy & paste. ;)
Rather than cleaning out the DerivedData directory from Xcode, have you tried the "old fashioned" way from Finder? Try quitting Xcode, nuking ~/Library/Developer/Xcode/DerivedData/ModuleCache from Finder, and restarting Xcode.

Trouble changing app's name in xcode 5

I am currently using xcode 5.1
I have successfully changed an app's name before using the same steps described this SO Question.
But for some reason I am having trouble right now. Usually, I have experienced this same screen. but this time when I changed the name it did not fully change everything.
When I view my project's targets, the old app name is still being used. If I clean and build my project, it will show the old name very quickly in the "progress bar" up at the top of xcode.
If I look at my project's supporting files folder, the plist still has the old app name ie. old-app-name-Info.plist
So far I have manually changed the project name, changed the bundle identifier, changed the Product Name in the Build Settings, and changed the name of the Scheme. I don't know what else to do.
The app now has the correct name when I run it on the simulator or on my iPhone, but the old app name is still being used throughout various areas in project folder's, xcode settings, etc.
I just want to fully change everything that use's the old app's name and make them use the new app name.
EDIT: Here's another example. If I go to the File Inspector tab the correct name is shown for the project, but if I go to the Issue Navigator tab it shows the old app name at the very top.
What do I need to do to change everything over?
This ended up finally changing it for me.
I went to the Project Navigator tab in xcode and clicked on my project. I then double clicked the target that still had the old app name, changed the name to the new app name, and hit the return key.
Everything is now correct and changed to the new app name. However, I still have no idea why the SO Answer that I linked to in my question did not get the job done in the first place.
I have used that solution several times over the past 6 months and it has always worked perfectly for me so I have no idea why it did not work this time.
Open your plist file and edit bundle name and bundle display name as you want.
This should do the trick.
Simply if you want to change the application name on devices go to the info.plist file on your application and Change Bundle Name to (yourAppName)
That's work for me. (XCode 6.3.2)

Xcode can build a project but can't run it on simulator

When I download a project from the web, sometimes it can be built but doesn't run (XCode -> Product -> Run is disabled, in grey). This never happens when I create projects myself. What could be the problem? Is it somehow connected with version?
I'm new to iOS development and download projects from the web for studying purposes. It's a pity not to be able to test them on the simulator.
Generally, if you can't Run a project, either:
It doesn't have a build scheme that knows how to "run". Check at the top next to the Run/Stop buttons that there's a profile name and target device shown. If the box says No Scheme then click on it and create a New Scheme. If there IS a scheme, click on the drop-down menu (left divider in Xcode 4.2+, anywhere on the box otherwise) and go to Edit Scheme to make sure the scheme was set up correctly for Running
It doesn't have a build configuration set. You should see this in the Run section of your build scheme. Check there's one selected. If the list is empty, go to the Project icon at the top of the leftmost pane, select the Project, go into the Info section, and create a build configuration, although there should already be at least one if you can build the project
It doesn't have a runnable target at all, which might mean you've got a project which compiles to a static library or framework for use in OTHER projects. If this is the case, you should see the icon for your build Target as a yellow toolbox (framework), or a little white building (a "library", although to me it looks more like the United States Supreme Court Building).
The target isn't valid for the Simulator, which means you might need to add i386 to the list of Architectures and Valid Architectures on the Target before you can run it
The target isn't valid for the currently connected device. For this one, check the Deployment Target number is set back enough to be valid for the device's version of iOS
Xcode can't see the connected device. Try unplugging and plugging it back in. If it still doesn't recognize it, you may have not added it to Xcode (Window -> Devices -> Select the device -> Use for Development)
Make sure that in your Edit Scheme (click on your project name next to stop button -> Edit Scheme), in the Info tab of the Run menu selection, that your .app is selected as the Executable. I had this issue and "None" was selected, happened after refactoring the project's name and reconfiguring the build targets.
you may download a project that the deployment setting (the ios version) is higher than the one your xcode support. if this is your situation, you has two options to sovle the problem.
try run the project in a older deployment option. follow these instructions (
if the project just setting to a higher version but not using any feature of the higher version. this approach should work):
select project file in xcode > select the target you are going to run > select summary tab > in section 'iOS Application Target' > in the combo box about 'Deployment Target' select the version that your Xcode support.
and then you could select and run the project in the simulator.
if the project dose use features in the higher version, then you should update your Xcode in order to run the project.
Hope this helps!
In my case the issue was really simple, I needed to check "Launch: Automatically" check in "Product > Scheme > Edit scheme > Run" menu.
When this setting wasn't checked I cannot find App icon in simulator to launch application.
In My Case Sole by Go->Project->Architectures->Architecture=select standard architectures(armv7,arm64)...
same as
Go->Target->Architectures->Architecture=select standard architectures(armv7,arm64)...

iPhone project has "My Mac 64-bit"

I'm working on an iPhone project and somehow the schema has "My Mac 64-bit" and "My Mac 32-bit" in addition to the normal "Simulator 4.3" and "IOS Device".
Is there anyway to remove the "My Mac..." options? It always wants to switch to these when I switch git branches and I end up building without realizing it and get an error. More of an annoyance than anything.
Could possibly be something with your xcuserdata folder.
Right-click on the xcodeproj file and select "show package contents."
Make a backup copy of the xcuserdata folder.
Now delete everything inside the xcuserdata folder, and restart xcode.
If causes a problem, then put backup folder back in.
This happens to me every time files get modified outside of Xcode, and Xcode needs to reload the project file. Closing the project and re-opening it always fixes the issue for me.
If you are porting your Xcode project from one mac to other then this issue happens most often. You can Try These two resolutions: First one only worked for me:
Resolution:1
Open Your project folder > Right Click on Xcode and Select “Show Package Content” Inside there we will get one folder “XcuserData”.> Open the Xcuserdata folder and delete all its content. >Now Launch the Xcode project again, the problem should be fixed now.
if the above resolution is not working then try this one:
Resolution:2
open Xcode > clicked on Manage Schemes and then Autocreate Schemes Now > Then select the new scheme in Xcode.
Hope either resolution should work for you.
This is a bug in the beta builds for Xcode 4.2, with regards to their handling of Git repos (confirmed at WWDC with Xcode devs). According to a friend of mine it's been fixed in Xcode 4.2 beta 5, but there are a bunch of issues with that build and you might want to hold off until beta 6.
Step 1: Right Click on Xcode project > Show Package contents > xcuserdata > Delete All content
Step 2: Open project > select target > (Project name)Tests > Host Application > select application > allow testing application APIs
Resolved :) Enjoy your Code
I always open my projects from within Finder to get around this problem. Browse to your project directory, eg /apps/iOS/iPhone/SingleViewApp. Double clicking the .xcodeproj file launches the project within Xcode. I see "Checking DDI Symbols" msg and soon after iPhone device name appears.

"Base SDK Missing" after upgrading to Xcode 3.2.5

So I took the step upgrading to Xcode 3.2.5 (iPhone SDK 4.2) and now I cannot run to device. I always see this now in the dev environment:
In my current projects, when going to the project settings I can only set the Base SDK to iOS 4.2 but this doesn't change the "Base SDK Missing" problem. :/
I can however deploy to the simulator, and change which version I want the simulator to load as.
Does anyone know how to fix this?
If I create a new project I don't get this...
Thanks
I solved this problem, by doing this:
Project->Edit Project Settings->Build->Base SDK->Latest SDK (4.2)
Project->Edit Project Settings->Build->iOS Target Deployment->iOS 4.2
Project->Edit Active Target (myTarget)->Base SDK->Latest SDK (4.2)
Project->Edit Active Target (myTarget)->iOS Target Deployment->iOS 4.2
And, If you still have problems:
Click the box that says base SDK missing, and select:
Simulator -> Debug
That should do it.
You can double-click or right-click on your target and pull up it's Info. Click on the build tag and look for the setting for Base SDK. You probably want this set to Latest iOS, which is a new option and should prevent this from happening the next time you upgrade.
However, you might be better off doing this at the Project level, by selecting Project -> Edit Project Settings and following the steps above. You can also select the general tab under the project settings and set your Base SDK with the "Base SDK for all Configurations" drop down. That has the advantage of fixing a problem that sometimes crops up with your linked frameworks (if they are all in red in the sidebar, you have the problem).
I found that, with Xcode 3.2.5 after setting the Base SDK to Latest iOS in the Project and Target Build info settings, quitting and restarting Xcode automatically got rid of the "Base Missing SDK" message in the select widget.
Here's what you have to do:
Double click on the main project icon to open properties.
Under the General tab, set "Base SDK for all configurations" to "Latest iOS".
Under Build tab, set Base SDK to the same thing.
Repeat this step for all framework projects under your main project.
Finally, and this is the bit I was missing for an annoying week or so, double-click your TARGET (under "Targets") and perform the same steps.
Things should be back to normal - and since "Latest iOS" should hopefully keep you updated with each new SDK released, you won't have to go through all that again.
Finally - restart Xcode or otherwise cause the project file to be reloaded.
Unless you work with people who haven't upgraded yet and persist in submitting changed project files. Apply a similar penalty as you would for breaking a build until they get it. :-)
RESTarting is must folks .. if u won't restart your project (just close the project and then reopen it ) you will see the same thing " base sdk missing"... i also had the same trouble .. but restarting works..
I do not think you need to restart xCode, nor reopen your projects. Try this:
In the main project window, select Option-Cmd-E, choose build and "latest ios...".
Close the build window.
In the main project window, option-click the dropdown for Base SDK and you should see the latest build available.
Select that and you should be good to go.
Takes 5 seconds. I hope this helps..
This works fine for me. Just don't forget to restart Xcode.

Resources