Xcode Thinks that OS X Targets Created in an iOS Project are in the iOS Build Directory
| Originator: | justatheory | ||
| Number: | rdar://19163498 | Date Originated: | 2014-12-05 |
| Status: | Duplicate of 11761819 | Resolved: | Duplicate |
| Product: | Xcode | Product Version: | Version 6.1.1 (6A2008a) |
| Classification: | Developer Tools | Reproducible: | Always |
Summary: I had an Xcode project in which I was working on a framework. Eventually, we decided to port it to OS X. Most of the code was the same, so I just added a new target for OS X. The target properly has CONFIGURATION_BUILD_DIR set to `build/Debug` and `build/Release`, but the product listing in the navigation pane expects to find the OS X product in `build/Debug-iphones` and `build/Release-iphoneos`. I suspect this is because the Products in the nav pane assume a project-global build directory, rather than a platform-specific (or target-specific) build directory. I think they should reference the target-specific directory. Bonus: Create yet another OS X target with the same PRODUCT_NAME as an existing iOS target. Because of the above, Xcode thinks they are the same build product. The attached project shows them both in Products for me, but I have other projects in which targets with products of the same name are shown only once. Ideally, Products would show the name of each product and, if there are dupes, the name of the target or platform in parens if there are products with the same names (and different build directories and/or platforms). This causes mayhem for dependencies, too. I try to depend on "foo.framework" in an iOS app, and it implicitly depends on a "foo framework for OS X" target, because it doesn't know whether to pick the iOS "foo.framework" of the OS X "foo.framework". The attached example project demonstrates some of these confusions. Steps to Reproduce: 1. Create a new iOS project in Xcode 6.1. 2. Add an OS X target to it. 3. Click on the iOS product in the navigator. Note in the "Identity and Type" pane in the Utilities area that its path ends in "Build/Products/Debug-iphoneos". 4. Click on the OS X product in the navigator. Note in the "Identity and Type" pane in the Utilities area that its path ends in "Build/Products/Debug-iphoneos". Bonus: 1. Create another OS X product. 2. Change its PRODUCT_NAME to be the same as the iOS target. 3. Click this new OS product in the navigator. Note that it has exactly the same build directory as the iOS target (ending in "Build/Products/Debug-iphoneos" again). 4. Note also that you cannot tell the iOS from the OS X target from each other in the Products area. 5. Try creating dependencies on these products in other projects. See if they get confused and pick the wrong target! Expected Results: I expected the OS X product to have its build directory end in Note in the "Identity and Type" pane in the Utilities area that its path ends in "Build/Products/Debug". I also expected to be able to see at a glance in he Products area whether a product was for iOS or OS X, or perhaps which target each comes from. Same goes for Schemes, BTW. Actual Results: The OS X product has its build directory end in "Build/Products/Debug-iphoneos". Xcode sometimes picks the wrong one when dependencies are created and products have the same names on both platforms. Version: Version 6.1.1 (6A2008a) Notes: Configuration: Attachments: 'PlatformProducts.zip' was successfully uploaded.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Apple Developer Relations15-Dec-2014 00:34 AM
Engineering has determined that your bug report is a duplicate of another issue and will be closed.
The open or closed status of the original bug report your issue was duplicated to appears in the yellow "Duplicate of XXXXXXXX" section of the bug reporter user interface. This section appears near the top of the right column's bug detail view just under the bug number, title, state, product and rank.