How to debug your build locally / "It works on my Mac/PC but not on bitrise.io"

iOS Code Signing - debugging Provisioning Profiles:

Xcode looks for provisioning profiles in a single directory: $HOME/Library/MobileDevice/Provisioning Profiles

To test whether your app can be signed with the given signing files (e.g. the one you upload(ed) to bitrise.io):

  1. Create a new directory, e.g. on your Desktop, call it “ProvProfile-Backup”
  2. Open the ~/Library/MobileDevice/Provisioning Profiles directory
    • from Finder: click Go (menu) -> Go to Folder and then copy paste: ~/Library/MobileDevice/Provisioning Profiles
    • or if you prefer the Terminal, run: $ open "$HOME/Library/MobileDevice/Provisioning Profiles"
  3. Move all files from ~/Library/MobileDevice/Provisioning Profiles into the “Backup” directory, to have a backup. Make sure that ~/Library/MobileDevice/Provisioning Profiles is empty!
  4. Now, activate the provisioning profiles you want to test, e.g. download from bitrise.io and double click the files, or just move them into the ~/Library/MobileDevice/Provisioning Profiles directory. Note: if you double click a provisioning profile file, Xcode simply copies that file into the ~/Library/MobileDevice/Provisioning Profiles directory, with the UDID of the profile as the filename, but the filename does not matter actually.
  5. Now try to build / archive / etc your project.

If the build fails, or you’re prompted that files have to be downloaded that means that those files are also required for the actions you do, so you’ll have to upload those files to bitrise.io as well.

Once you can perform all the actions (build, archive, generate ipa, etc.) you want to, that means that all required provisioning profiles are in ~/Library/MobileDevice/Provisioning Profiles, and you can simply upload all of the provisioning profile files from ~/Library/MobileDevice/Provisioning Profiles bitrise.io / copy to another Mac etc. and if the certificate is available on the Mac (or on bitrise.io) the build, archive, export ipa etc. actions will work on the other Mac too.