How to duplicate target from Xcode 5? - ios

Seem like this feature was removed from xcode 5 ?
Prior to xcode5, it is easy to duplicate any target via clicking on the target, choose "duplicated blabla", then you will get it.
But for xcode5 , where is this hiding ?

Step1: Select the (blue) project icon in Xcode and open project setting page.
Step2: Click on the black arrow icon and explore the targets
Step 3: Duplicate your target by selecting the target and press "cmd+D" keys. You can rename as you like.
Enjoy!!

Select your project in the left nav. In the main content area at the top, you have a row that is like a file navigator. Then the second row, right under the first, in the very left there is a little square arrow thing. That hides/shows the project and targets list.

This is the screenshot from xcode 6:

It's still there - right click on target or use CMD + D shortcut after selecting target

Related

How to Delete a Swift Package from XCode?

I want to delete swift package, but the delete action is disabled. So, how can I do?
It is not about the Xcode 12. As you realized your folder is red.
Probably you removed this folder from the target is supposed to be referenced from here..
In other words Xcode can't see this folder. That is why your delete button disabled.
Just delete from target and restart the Xcode so it will be removed.
Click your project > Swift Packages and click - as below
In your project navigator (the left sidebar), click on your xcodeproj (the one with the blue icon).
In your xcodeproj, click on your project, then click on your project. You should be able to manage your packages under the "Swift Packages" section.

XCode 7.3 Not showing "general" tab in options.

I'm trying to access the "general" tab of the Xcode options for a target I'm trying to build but there seems to be none.
Heres an image of my settings tab with the target selected: http://imgur.com/ljgW9j6
Try this.General option
Click the left top corner icon (Hide project and targets list button) that appears in the image and then a list will show you your project, then click your project and the general option now appear.enter image description here
It looks like the project was not created correctly for iOS. You need to do File->New->Project. Then, go to iOS category and choose your project type (usually single view application). Then input your project name, preferred language, organization, etc. and create the project. Now, when you click on the target, you will see the general tab.
that message is talking about your IOS device general tab so you have to go to your (iphone or ipad) setting -> general -> (in IOS 11)Profile & Device Management -> Then select your apple Id which is signed in xcode
Note: your ios device should connected to internet

In Xcode, how do I use a different AppIcon for each target iOS App?

I have one Xcode project (in Xcode 6.1) with a 4 targets for 4 different apps that share a lot of the same source code.
I'm trying to have each one of them show a different app icon.
Going into Project > General > [select target] > App Icons and Launch Images, I see this:
But clicking on each AppIcon, I get to the exact same app icons - not the ones that I would like for each project.
Is this just a bug in Xcode? How can I use different app icons for different targets?
Click on your already existing xcassets File, where you have defined the Appicons for your first target and add a new Appicon.:
You can give the new Appicon a meaningfull name (In my case Appicon-Debug):
Go to your targets and select the new target:
choose the new AppIcon under General -> "App Icons and Launch Images" -> "App Icons Source":
Clean the project and rebuild it.
Go to your app's Assets.xcassets and create a new iOS App Icon by clicking on the + button in the bottom left corner of target's section
Name it AppIcon-Test or Debug or whatever name suits you.
Go to xcassets folder and in the utilities panel allow target membership to both in the File Inspector View. Make sure the all target membership's are enabled for both AppIcon sets.
Select the target for which you want to change icon in the project settings. In "General" Scroll down to App Icons and Launch Images. Select your appicon set for the respective target in App Icons source
Happy coding :)
I had a similar issue when using multiple targets. Trying to change which asset set is used just didn't work, it would always just auto select the first one in the list. The way I solved this was to rename the AppIcon in each asset set e.g. AppIconMobile and AppIconTablet.
CLick on the Arrow at right most, which will take you to Xc-assets screen, where you can set images.
Similarly click on other target and set images. If you open your project in finder window, you can notice ProjectName.xcassets where you can see different app icons set. you can copy directly to this folder aswell
I think you just need to create Assets.xcassets for each target
Then create an AppIcon in Asset, no need to give it a different name in each asset
Select the AppIcon on the general section of each target
On top of every other suggestions, you also need to clear Build Folder (top menu Project -> Clean Build Folder), close Xcode, remove app from device / simulator, close simulator, open Xcode and run it again. Otherwise, Xcode will keep cache of your old App Icon.

can't run iOS project in simulator nor device

I made some changes in my xcode project, which somehow, causes me to not be able to run the app in the simulator nor device. The only option that I can see now is My Mac 64 bit. How do I fix this? The target is correct.
Try this:
Go to Edit scheme (Drop down near the stop button), then select Excecutable as "yourapp.app".
If you open the project in XCode (4.4.1), on the left top click the folder icon, then select your project icon to bring up the project settings page. Click on the "Summary" tab, then you should see "Devices" where you can select the device you want to target.
If that doesn't work (you don't see "iOS Application Target") you may need to go into "Build Settings" and select a different "Base SDK" -- I usually select "Latest iOS". You may have selected a Mac OS X SDK. Also check "Supported Platforms" to select "iOS".
Another Way which did it for me ...
go to manage Schemes and click Autocreate schemes now on the upper left side ..
hope it helps

How to disable no inverse relationship warning for CoreData in Xcode 4.2?

There was a MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS setting on Xcode 3 but I cannot find it in Xcode 4.2 and trying to set it as a user defined build setting have no effect.
I know why I should use inverse relationship but I just don't want it for various reasons.
In XCode 5, 6 and 7, you can still set the variable.
Navigate to Build Settings
A. Select your project on the left side bar under Project Navigator.
B. Select the "Build Settings" tab.
Find and set MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS
A. Select 'All' in the upper left of the main screen.
B. Search for MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS by pasting the key into the search bar.
C. Change value to YES.
Build again and the warnings are gone.
****EDIT****
Thanks #RajTandel for the comment. If you still see the warnings, restart Xcode and the warnings should go away.
Using XCode 4.3:
Find your way to Build Settings
Select project node (top node) in the project Navigator
Select your project under Targets
Select the "Build Settings" tab
Find and set the MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS setting
Scroll all the way down the build settings to near the bottom and find the section named "Data Model Version Compiler (MOMC) Warnings"
The first entry is "MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS" and it defaults to NO
Change it to YES
Build again, and the warnings should vanish.
The setting is still there in Xcode 4. At least it is for me when I create a new project in Xcode 4.2 that uses Core Data. The MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS setting is in the Data Model Version Compiler (MOMC) Warnings collection, which is towards the bottom of the build settings list.

Resources