'how to properly archive an ios app xcode 13

Well there are lots of articles/blog on archiving an iOS app, i've tried several of them, but i end up getting one error or the other, I'm setting up CI/CD, and I'm at the stage of archiving my app.

These are the most promising errors i've gotten so far, i say promising cause other errors encountered seem to be dead ends, but the below commands seems to be a step in the right direction.

1st Command

xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -sdk iphoneos -configuration AppStoreDistribution -archivePath $PWD/build/MyApp.xcarchive clean archive

Output

error: Signing for "MyApp" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'Decred Wallet' from project 'MyApp')

2nd Command

xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -sdk iphoneos -configuration MyApp\ Release -archivePath $PWD/build/MyApp.xcarchive clean archive

Output

error: No profiles for 'com.mydomian.myapp.test' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.mydomian.myapp.test'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'MyApp' from project 'MyApp')

has anyone done this recently, I need some insight please.

also a few steps to this i already created a direcory mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles and copied my mobile provisioning file there, i also created a keychain and imported my .p12 file into it



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source