xcodebuild / Jenkins can't find the PROVISIONING_PROFILE for an iOS job - xcode4

I can build with Jenkins/xcodebuild when the project has the correct Provisioning Profile selected.
We want to be able to set the provisioning profile in xcodebuild.
Unfortunately, when the jenkins user runs
xcodebuild PROVISIONING_PROFILE="XXX"
...Lots of build output...
Check dependencies
Code Sign error: Provisioning profile 'XXX' can't be found
I can run the same line and have it work with a regular user account, accessing the file in ~/Library/MobileDevice/Provisioning Profiles/
The provisioning profiles are stored in /Users/Shared/Jenkins/LibraryMobileDevice/Provisioning Profiles
Anyone know where else the Jenkins user would be looking for these?

To answer this question: the provisioning profiles must be named after the UUID.
If you download and do not rename a .mobileprovision file, it will not be read by xcodebuild
A script for doing so is in another StackOverflow answer

Related

Firebase trouble when initializing CLI to deploy a react app

I keep getting the error below:
? Are you ready to proceed? Yes
? Which Firebase features do you want to set up for this directory? Press Space to select features, then Enter to confirm your choices. Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
? Please select an option: Use an existing project
Error: Failed to list Firebase projects. See firebase-debug.log for more info.
PS C:\Users\xxxxxlinked-in>
I have tried everything I can find on StackOverflow:
firebase login will log me in.
I have also done the firebase login --reauth one and also just reinstalling it npm install -g firebase-tools.
Its just when I go to use an existing project.
If it helps to know, I keep gettin another error when uing this command firebase projects:list.

Unable to set up Export Collections to BigQuery extension. Unable to uninstall: failed to remove IAM roles from Service Account

I tried installing the Export Collections to BigQuery extension to send firestore collection data to BigQuery. The installation succeeded but could never get the queries to work. I kept getting the error:
Not found: Dataset myproject:firestore_events was not found in location US
I tried uninstalling and reinstalling. I now have two instances of the extension and attempts to uninstall fail with ther error:
failed to remove IAM roles from Service Account for projects/myproject/instances/firestore-bigquery-export
Is there a way to uninstall manually?
Is there a way to install manually?
The following error message means that your FROM statement may not contain the proper query structure - project, database, and table:
Not found: Dataset myproject:firestore_events was not found in location US
For example:
SELECT *
FROM `my-project.my-database.my-table`
Please note the backticks.
Refer to Error: Not found: Dataset my-project-name:domain_public was not found in location US for details about a similar issue.
Now, in regards to the second error message:
failed to remove IAM roles from Service Account for projects/myproject/instances/firestore-bigquery-export
I suspect that after reinstalling and uninstalling one of the extension instances, its service account might already be deleted and thus failing to remove its IAM roles.
The installation of this extension generates a new service account that has the BigQuery Data Editor role to access your project and resources. This role allows the extension to configure and export data into BigQuery.
From documentation:
When you uninstall an extension from your project, Firebase deletes the service account created for that instance of the extension. After this deletion of the service account, the extension cannot run in your project because it no longer has any access rights to your project or data.
I was able to uninstall and reinstall the Export Collections to BigQuery extension to avoid duplicates in my project without any issues.
To answer your last question, I am not aware of any other methods to install/uninstall Firebase extensions other than what is shown in the documentation. You can install the extension using the Firebase Console or the Firebase CLI:
1 - Install the Firebase CLI or update it to the latest version:
npm install -g firebase-tools
2 - Install the extension:
firebase ext:install firestore-bigquery-export --project=projectId_or_alias
Edited
We can take the following steps to troubleshoot error:
failed to remove IAM roles from Service Account for projects
Please make sure that you're the owner of the project that you are installing extensions in.
Refer to this GitHub issue to uninstall the extension using the CLI.
If that didn't help, try disabling and re-enabling the Firebase Extensions API inside the GCP Console.
Please make sure that Firebase Management API is enabled in your project.
If that didn't help, navigate to the IAM Permissions page on the Cloud Console, and find the service account.
Add the Cloud Functions Developer and Firebase Extensions API Service Agent roles.
If those roles not available for some reason, just adding the Project Editor role also works as a catch-all. However, using the catch-all also provides additional permissions to the service accounts.
I had a similar issue when installing a Firebase Extension.
My error was adding an IAM role that did not exist, this not only failed to install the extension, but also then stopped me from uninstalling with the error failed to remove IAM roles from Service Account for.
To fix this issue I edited what I knew was the broken permission to be the correct role and then ran the following...
firebase ext:update ${ext-name} . --project={project-name}.
Alternativley, removing all roles completetly from the configuration and updating will have the same result.
One completed, the uninstallation process will automatically continue and uninstall your extension.

Cloning AWS codecomit repo

I just started with the AWS codestar and wanted to clone the codecomit repo. I generated the username and password for the repo and had it saved.
I am trying to enter username and password but every time I get Unable to access error with code 403.
I have 2 question here on:
1) is there an easy way to just copy the password from .csv file which I downloaded from AWS in the git command while cloning the repo.
Typing that long password is nerve wrecking.
2) Is there a way to create a second set of git config which can be used with this repo as I already have some other git credentials saved which I do not wish to override as part of global config. Something like we do in aws-cli named profiles.
Here's the answer from Amazon AWS forum link. I hope this will answer all you queries.

Xcode Server - Xcode 9 - Uses An Old Provisioning Profile

Xcode archives successfully using the latest - and correct - provisioning profile.
However, the Bots configured in Xcode Server still use an older profile.
This can be seen if one authenticates as xcodeserver user and navigates to ~/Library/MobileDevice/Provisioning Profiles.
Running security cms -D -i myuuid.mobileprovision confirms this.
Having tried reconfiguring a new Bot, restarting Xcode Server, deleting the old profile, and so on, nothing works.
How can we help Xcode 9 Server do what it promised, and use the latest provisioning profile from the Apple Provisioning Portal?
A dirty hack will work. This is assuming Xcode will correctly Archive using the correct profile. Unarchived the resulting .app file, then rename the embedded.mobileprovision file according to it's UUID, e.g.
myuuid.mobileprovision
Next, copy myuuid.mobileprovision to the ~/Library/MobileDevice/Provisioning Profiles folder.
Identify any older profiles linked to the same bundle identifier and delete. To play it safe, consider moving temporarily to ~/Desktop.
Finally, integrate the Bot, unarchive the resulting .app., and inspect to confirm creation expiry date, UUID, and UDID array are all as expected:
security cms -D -i embedded.mobileprovision

Xcode Code Sign error: Provisioning profile 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' can't be found

I submitted a couple apps last week that were revoked by Apple. I fixed them and tried to sumbit these apps again.
I have been getting this error for two days. I erased all my certificates and provisioning files on the provisioning portal and created all new ones . Also, I cleaned up everything in my keychain.
I am sure I am using the correct provisioning file in Xcode's build settings, and yet I still get this error. Why?
I solved this problem by the following steps:
Go to the file path where you save your provisioning file:
~/Library/MobileDevice/Provisioning Profiles
and remove all the provisioning files you have downloaded today.
Download the new provisioning file from the Apple member center that matches your project.
Press Command+B, rebuild the project, and see if this issue still exists.

Resources