How to prevent Xcode 8 from saving "development team" in .pbxproj? - ios

Xcode 8 demands you select a "development team" before you can sign your apps for both iOS and macOS. It wasn't very difficult to figure how to make the selection. (Answer can be found in Add developer team in Xcode 8? in case anyone can't figure it out themselves.)
The problem is that Xcode saves the selection in the .pbxproj file. Since in my case, and I expect many others, this is under SCM, and the project is used by many unrelated people & teams, this is a huge problem. For example 'git status' shows the work area is not clean as soon as the team has been selected.
Is there a way to either
get Xcode 8 to save the selection in user rather than project data, or
specify a default "development team" for all Xcode projects?

You can abuse Xcode’s Custom Paths mechanism to store your development team identifier outside of the project.pbxproj file by setting a DEVELOPMENT_TEAM custom path (replace ABCDEFGHIJ with your team identifier):
(Xcode menu → Preferences… → Locations → Custom Paths)
The custom paths are stored in Xcode’s preferences (IDEApplicationwideBuildSettings and IDESourceTreeDisplayNames).
But there’s a catch! Unfortunately, as soon as you change anything in the project (update a build setting, add a new build phase, rename a target etc.) the development team will be automatically added to the project.pbxproj file (in the TargetAttributes of the project object). This requires constant care not to commit those changes.
If this practice of setting your DEVELOPMENT_TEAM as a custom path gains traction, open source project owners will be able to not specify any Development Team nor Provisioning Profile, set the Code Signing Identity for Any iOS SDK to iOS Developer ("CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";) and open source demo apps will build and run on any device just like it did with Xcode 7. 😃

I upgraded my project from Xcode 7.3.1 to Xcode 8, and never set a Development Team or non-deprecated Provisioning Profile, and things still work fine.

Related

An empty identity is not valid when signing a binary for the product type 'Application' in xcode version 10.2

I have compile webrtc ios source code ,then I used the command:
gn gen out/ios --args='target_os="ios" target_cpu="arm64"' --ide=xcode
then I open the workspace with Xcode.
but when I compile the code, Xcode gives me this error below.
An empty identity is not valid when signing a binary for the product type 'Application'. (in target 'AppRTCMobile')
my Xcode version is 10.2, the latest version.
I really don't know how did this happen,can anyone can help me?
my code sign setting is:
everything looks ok.
I added CODE_SIGNING_ALLOWED=NO as an additional parameter and that fixed this issue for me.
I needed to to turn OFF Automatic manage signing and turn it ON afterwards. It seems like Xcode did fix some inconsistency by that action.
I saw this error in Xcode 12.2b when building to run on a device, but I had not set signing to Automatic, or selected profiles, etc.
Basically I was running and testing on the simulator, then plugged in a device for testing and forgot to change any signing settings.
Perhaps this error is new to Xcode 12.x for that scenario.
If you're using CocoaPods check your project.pbxproj for (null) references, there's an issue that make BuildFile references to become (null)
Even if you have the identity correctly defined it may be "empty" because of this issue
Try, as suggested:
pod deintegrate
pod install
This error can occur when an Xcode project is generated (rather than built from within xcode), and the generated output project is unexpectedly in release mode.
I was working on a Godot project and got the above error which led me to this post. The error is not WebRTC or Godot specific.
If you only want to debug the project for now on a device, and don't need release builds yet, switch to a debug scheme using the scheme switcher (1)
If the generator didn't create a debug scheme, (which is the case for me for my issue) you can add one via New Scheme (2)
At first I could not work out why it was complaining about "empty identity" (this refers to the Team drop down) when as per the screen shot I had this value set. I had the project view filter settings on Debug (as per the screenshot (3) so the Release settings (where Team was set to "None") were not showing up. Change this to All to see if that is where the None in the error is coming from for you.
Debug builds only require a basic signing setup. If you still have issues with Release builds when it comes time for that, you may need to clear out certificates & provisioning profiles from your Derived Data, Apple Developer portal and Keychain.
Release build certificates are hard to manage & replace so be careful with randomly generating & deleting them.
The problem has been fixed, it's my mistake.
Select the target, then choose info.plist and select the one for your project.

React Native ios app build failed with "select a development team error"

I have initialized an app with react-native init something.
When I try to build it with Xcode it's throwing me this error.
Showing Recent Messages
:-1: Signing for "organiseTests" requires a development team. Select a development team in the project editor. (in target 'organiseTests')
But I have added the developer account in the Signing section.I'm using Xcode 10.1 and my physical device is iPhone 6
You also need to set the team in the test target as well as mentioned in the error message.
Even though its not required to set the team in other targets if you are not compiling them but Xcode sometimes gives error.
You can show the Targets in the following way:
Open XCode
Click at the very Top Element in the Explorer
If Project-Tab is not shown, click the Icon to make "Project-Column" visible.
There you see all your targets. Remove unneeded Targets, or check if Team is choosed for each Target.
You can try selecting the team as none. The provisioning profile should show none required.

How to handle framework with dev and release versions in iOS?

In my project I am using a framework which contain simulator,dev and release version.How can I test the release sdk?What are the particulars that I have to check?
As far as I know ,I can change the scheme and create a release build.I want to know if it will automatically choose the release sdk or not?
Or do I have to create an archive and install as ipa file?If I can install the app via xcode do I have to remove the cable and launch the app manually?
If it helps someone :
If you have separate release sdk and dev sdk, you can select either of them as required by editing the scheme setting (Product->Scheme->edit scheme).
As you can see in the image below,You can set the build configuration separately for running,testing,profiling,archiving etc.
For testing the release sdk,you can select the build configuration to release and properly setting the framework search path,header search path etc in the buildsettings and run the code.
By changing the archive scheme setting to release,we can choose the dev/debug sdk to generate the ipa file for development deployment(Check out the following link for more details).You may have to use the development provisioning profile to do so.
Link 1
Link 2
Link 3
It's very straightforward with Xcode:
For me it builds dylib release version this way. If you just do build, Xcode builds debug version.
David

No valid iOS code signing keys found in keychain

I can Archive and Publish an app in debug mode, but when switched to App Mode i get the following error:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: Error: No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com.
the attached file shows i do have the relevant Certificates but Xamarin keeps complaining
The app has been successfully published before but using a different profile on the same mac. Both users key chains contain the same certificates
I resolved that changing plataform build configuration from iPhone to iPhoneSimulator.
got it work in the end by remving all the certificates and then putting them back in the Key chain
I get this error when I open Xamarin University Exercises with Visual Studio 2015. A bug was entered and they decided that it is expected behavior. Xamarin Bug
If you work in Xamarin Studio and set this property for whatever reason, then open it in VS, you may hit this issue with no way to edit / remove the Entitlement setting in the Project Properties.
I guess the Exercises are created with Xamarin Studio.
The accepted workaround is to open the iOS .csproj and manually edit the <CodesignEntitlements></CodesignEntitlements> for the Debug|iPhone PropertyGroup.
I struggled too for the last day to make Xamarin (now Visual Studio for Mac) successfully deploy on my device with the free developer signing (since I'm new in this area and I'm not ready yet to join the developer program yet), and what helped was to first deploy a dummy app with the same bundle identifier from XCode like others suggested on different sources, keep CodesignEntitlements as it is in the .csproj file, but replace CodesignKey's value iPhone Developer like in the answer here: https://stackoverflow.com/questions/58062268/no-valid-ios-code-signing-keys-found-in-keychain-you-need-to-request-a-codesign#=
Hope this will help somebody in the future like it helped me!
Sometimes that happens when you newly start your computer and Visual Studio. Just don't hit green triangle debug Combobox-button and check what is selected in this combobox. If it is "Device" as in picture 1 select a simulator from the list as in picture 2 and start debugging. Else you get this error since VS will try to start debugging in a real device if "Device" selected in the combobox.
you can try either of this
remove any keys, if existing form Entitlements.plist .
Change the proj run mode to debug , select device .
I needed to create Signing Identity certificate from scratch and recreate Provisioning Profiles (on apple developer site). Then download using xcode.

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)...

Resources