With XCode 8.x how do you clone an existing target? - ios

With XCode 6.4 I could easily clone an existing target. However this functionality doesn't seem to be available in XCode 8.x.
Does anyone know how to do it?

Select your target, right-click on it, then select Duplicate.
As you can see - the project now has 2 targets:

I could not figure out what I was missing. The above answer is missing a step. The panel where you can duplicate targets is probably hidden.
Click the side panel button to see the targets.
Now you can see the targets and right click to duplicate, then just click on the name and rename it. Much easier.

Related

Xcode 10.1 doesn't show 'distribute app' option when archiving, can't archive

I suddenly got this weird issue with Xcode 10.1.
When I archive app store target for my app I cant see "distribute app" option, instead it now says "Distribute Content" and neither I can export ipa nor upload to app store directly.
My archive comes under "Other items" in Organizer instead of iOS apps.
It seems to work fine with development target though.
Here is the screen shot.
Anyone with any knowledge about it please help.
Thanks
Please make changes as follows
Change Skip install to NO
Make sure only the Application has this set to NO. Embedded Targets like Frameworks need to have Skip Install = YES
Faced the same issue few days ago. This usually occurs when you have multiple schemes in a project.
Go to edit scheme (Next to stop button)
Select the target of which you want to archive.
In build option, remove other targets or you may unselect archive checkbox.
Re-archive
I ran into this annoying error today - I thought it was the new version of Xcode - but no. I had multiple targets for my project (staging/production), and also a nested framework project.
To solve this I opened the staging scheme and made sure only the checkboxes are checked for that target: (the top row was selected before)
I have run into this situation and solved it.
The solution set SkipInstall=No does not work for me.
I find the reason for my situation is that I imported a framework by adding it into Link Binary With Libraries section.
So I changed a way to import the framework.
Remove the framework at Link Binary With Libraries section.
Add the framework directory to the framework search paths.
For more information ,see my blog at JianShu:
https://www.jianshu.com/p/c65599da18c0
i got the same issue and nothing works from above answers. so i debugged my code and i found out that there was a folder that was missing and instead of showing any error i was getting "distribute content" instead of "distribute app". So if anyone have the same issue please check for the red folders or swift files in their xcode.
Unticking the 'Find Implicit Dependencies' tick box solved it for me. Hope this helps.
I had the same problem in different projects in the last few days.
In one of the projects, a solution had to delete the .xcproject subproject file.
In another project, the solution was to uninstall .xcworkspace (I use cocoapods) and run pod install.
Thanks for the old answers, I have solved the problem by keeping "Skip install" of frameworks to false.
My XCode is with version 13.2.1. One thing special is that runner and framework in my project are in different schemes. Hope the picture will help newcomers.
I got the same issue, I tried skip install setting it with "No" didn't work for me.
I removed the script added for swiftlint in build phases then it works fine.

Xcode doesnt have Embed Frameworks section

I'm having a problem. I'm trying to implement Amazon frameworks in my ios xcode project and I also need to add them in Build Phases > Embed Frameworks section. But there is no option in my xcode window. Here is the screenshot
How is this possible. The problem remains even if I create new project.
Hello in your general Tab with your target selected check for section named
Embedded Binaries
I hope this help you
Another reason Embedded Binaries tab doesn't show up in Xcode is if you're in a command line project instead of a cocoa project and you're targeting Mac OS X.
You can create it on Build Phases tab!
Just click in the "+" icon and select "New Copy Files Phase". After that, rename the item created to "Embed Frameworks" and set the "Destination" field to "Frameworks".
You can tap the General tab to see those sections.
As an aside, using CocoaPods or Fabric will make that integration easier on you.

XCode: add build phase is disabled

I want to add Crashlytics plugin to my iOS project that demands to add Run script phase. But no matter what I do - for add build phase all options are disabled:
I select Target -> Build Phases
I have proper scheme
My project runs well - no issues,
I run Xcode 6
I answer on my question because took me time to find right solution.
Its really strange that the same issue migrates from old versions to XCode 7+.
I found solution in one of the comments of similar problem:
how-to-add-a-copy-files-build-phase-to-my-target (credits to #Paul Solt)
Its a bug, when user selects Build Pahses tab, XCode doesn't see that.
Solution
select Target -> Build Phases
After, click on any area under search form or better way, just open Target Dependencies drop down
Editor -> Add Build Phase
I hope it will save time to someone instead to read comments ;)
The upvoted solution did not work for me but there is another - even though the "Editor->Add Build Phase" is grayed out the small "+" in the top left of the "Build Phases" pane is not, and it works.
So select the project in the project navigator
Select the target
Select "Build Phases" in the top bar of the content pane
Click the "+" symbol in the top left of the "Build Phases" pane
Maxims answer did not work for me.
I had the same problem and solved it as follows and I opened a bug against apple: issue 22516266 on https://bugreport.apple.com
Here is how I solved the issue for me:
1.) Edit Scheme ...
2.) In the relevant phase of the schema you can add scripts as Pre-Actions or Post-Action, where you will find "New Run Script Action"
I think you pretty much create any workflow you like with this.
Hope that helps.

Xcode 5.1.1 not recompiling subproject

I have 2 projects within my workspace (see screenshot), but when I make changes to my secondary project (SDK), it doesn't recompile them. For example if I just write random uncompiling code, it still compiles. Xcode also doesn't break at those breakpoints in the secondary project but it breaks in the primary project. I've tried deleting DerivedData and also cleaning the workspace. Any ideas? Thanks!
Check in the Utilities of Xcode if the .m files from your secondary project are in the Target membership.
UPDATE
I think I just replicate your problem on my side, and found the solution that fixes it. Try going in Products > Scheme > Edit Schemes. Select your primary project scheme in the upper left part of the view, the go in the Build section in the left menu. Click on the plus sign and add your secondary project target.

xcode 5 how to delete target

In xcode 5, there is no option for creating unittest project while creating project. I want to delete the unitest target after the project is created.
There is no target list I can right click, I can chose target to edit but not able to delete. I know it should be really basic and really simple. But I google it and play around for almost half day, still confused.
Can anyone help?
Thanks,
You probably just hid this menu with the arrow in it:
In Xcode 6 its different as to how to delete the target. See these pics.

Resources