Signing app with xcodebuild command line with PROVISIONING_PROFILE fails
Using PROVISIONING_PROFILE
is deprecated since Xcode8. Try PROVISIONING_PROFILE_SPECIFIER
instead. PROVISIONING_PROFILE_SPECIFIER="Human Readable Prov Profile Name"
It may also be necessary to turn off Xcode's Automatic Signing:
Xcode9: simply append CODE_SIGN_STYLE="Manual"
to your xcodebuild command
Xcode8: sed -i '' 's/ProvisioningStyle = Automatic;/ProvisioningStyle = Manual;/' TestApp/TestApp.xcodeproj/project.pbxproj && xcodebuild ...
You can check your Xcode Version on the command-line with xcodebuild -version
TheWaterProgrammer
#include <AlwaysAStudent> int main(int argc, char *argv[]) { std::thread always_keep_learning([&] { Learn(); }); always_keep_learning.detach(); return 0; }
Updated on June 04, 2022Comments
-
TheWaterProgrammer almost 2 years
I trying to sign my app command line using Xcode.
Running
xcodebuild
command-line onMyApp.xcodeproj
like so:xcodebuild -project "MyApp.xcodeproj" -target "MyApp" -sdk "iphoneos" -configuration *Release* PROVISIONING_PROFILE="xxxx-xxxx-xxxx-xxxx" CODE_SIGN_IDENTITY="iPhone Developer: something.com (SOMEVALUE)"
Gives following error:
Check dependencies Provisioning profile "iOS Team Provisioning Profile: *" doesn't include signing certificate "iPhone Developer: something.com (SOMEVALUE)". Provisioning profile "iOS Team Provisioning Profile: *" is Xcode managed, but signing settings require a manually managed profile. Code signing is required for product type 'Application' in SDK 'iOS 10.3' ** BUILD FAILED **
What is wrong ? What is missing in my
xcodebuild
command ?How can I include the signing certificate that its asking about ?
What I tried from answer & comments below
As I understand, a dedicateddistribution profile
should be used with Release build. That is present in the system. I just need to know how to use it withxcodebuild
command for manual signing if I can.Executing
security find-identity -p codesigning -v | grep "$CODE_SIGN_IDENTITY"
gives a list of 5 signing identities ones of them clearly states asiPhone Distribution: My Company (SOME123ID)
.*So, can I use the distribution profile with xcodebuild manual signing? If yes, How can I get the actual ID of a distribution profile to use with xcodebuild command?
-
TheWaterProgrammer almost 7 yearsI tried
PROVISIONING_PROFILE_SPECIFIER="iOS Team Provisioning Profile: *"
withxcodebuild
command. I also tried the ID of the provisioning profile. Both didnt work. the error saysNo iOS profile matching 'iOS Team Provisioning Profile: *' found: Xcode couldn't find a profile matching 'iOS Team Provisioning Profile: *'. Install the profile (by dragging and dropping it onto Xcode's dock item) or select a different one in the General tab of the target editor.
-
TheWaterProgrammer almost 7 yearshow can get the name of my provisioning profile. I am sure it is installed in the machine I am trying to make this work. since on that machine I am able to build+sign the app using Xcode UI editor. Just doesn't work command line
-
Sven Driemecker almost 7 years1. Are you sure you want to build your project with Release configuration but Development Signing? Seems a little odd. You may want to switch to
-configuration Debug
or explicitely configure Distribution Cert and Profile. 2. Double Check that the configured Cert is really linked in the Prov Profile 3. You can look up the profile's name in the profile itself: open in any TextEditor and search for <key>Name</key> 4. You may have multiple Profiles with the same name installed at$HOME/Library/MobileDevice/Provisioning Profiles
. Be sure that all profiles have a unique name -
TheWaterProgrammer almost 7 yearsPlease dont mind. I am a little new in understanding this. I am trying to sign my app for Release build. why do you call it a Development signing ? I am with
PROVISIONING_PROFILE_SPECIFIER="iPhone Distribution: My Company (98U8AKJSDF)"
. Something like this. Its a long list ofmobileprovision
s in$HOME/Library/MobileDevice/Provisioning Profiles
. Is it possible to get thePROVISIONING_PROFILE_SPECIFIER
from a mobileprovision` if one of them is correct ? -
Sven Driemecker almost 7 yearsNo problem :)
iOS Team Provisioning Profile ...
always refers to a development profile, so this doesn't help in your case. You need a distribution profile to match your distribution cert and release config. Do a backup of$HOME/Library/MobileDevice/Provisioning Profiles
, then clear the folder, then let the Xcode UI build your project with Release configuration. Xcode's automatic Code Signing should download the proper Profile for your. You can then use the profile's name as value forPROVISIONING_PROFILE_SPECIFIER
-
TheWaterProgrammer almost 7 yearsOn Xcode UI IDE, if I drag & drop the
provisioning profile
in use then it makes a.mobileprovision
. Is there some way to get the correct name of provisioning profile from the.mobileprovision
? And input that into thisPROVISIONING_PROFILE_SPECIFIER
withxcodebuild
command ? Looks like I am able to open the.mobileprovision
with TextEdit -
TheWaterProgrammer almost 7 yearsImportant question pls: Is there a way to pass the
DEVELOPMENT_TEAM
withxcodebuild
command? Now its a different error. It saysSelect a development team in the build settings editor that matches the selected profile
-
Sven Driemecker almost 7 yearsYou can override any buildsetting when calling xcodebuild, so you can of course do DEVELOPMENT_TEAM="ABCDEFGH" (should be 10 characters, see
<key>com.apple.developer.team-identifier</key>
in your prov profile) -
TheWaterProgrammer almost 7 yearsA new error this time:
Provisioning profile "iOS Team Provisioning Profile: com.myapp.something.something" is Xcode managed, but signing settings require a manually managed profile
. Something to do with the provisioning profile ? thanks for the help until yet. Really appreciate -
Sven Driemecker almost 7 yearsYou're welcome. Like I said above, you can not use Team Provisioning Profiles for Manual Release Builds. You have to setup a dedicated Distribution Profile. Or let Xcode's Automatic Code Signing do this for you
-
TheWaterProgrammer almost 7 yearsLet us continue this discussion in chat.
-
TheWaterProgrammer almost 7 yearsThe dedicated distribution profile that you mentioned should be used with manual signing looks to be present in the system. I just need to know how to use it with
xcodebuild
command. Executingsecurity find-identity -p codesigning -v | grep "$CODE_SIGN_IDENTITY"
gives a list of 5 signing identities ones of them state asiPhone Distribution: My Company (SOME123ID)
. *So, can I use the distribution profile with xcodebuild manual signing. If yes, How can I get the actual ID to use with xcodebuild command? -
Werner Altewischer over 5 yearsIs it possible to supply multiple profiles this way (in case you need to build app extensions more than one profile is required)?