Roman Starkov
Roman Starkov

Reputation: 61512

How to un-set `fastlane_tmp_keychain-db` as the default keychain?

I'm not entirely sure how I get into this situation, but fastlane_tmp_keychain-db becomes my default keychain after a build, and I can't figure out how to un-set it.

enter image description here

enter image description here

There are no options here to change the defaults. Why did fastlane do this and how do I undo it?

It's definitely the default; I get "Spotlight wants to use fastlane_tmp_keychain-db" on login.

Upvotes: 24

Views: 7122

Answers (4)

Cyril Cermak
Cyril Cermak

Reputation: 339

If the keychain gets set as default then the easiest is to set the login keychain back as default:

security default-keychain -s ~/Library/Keychains/login.keychain-db

Once done, fastlane_tmp_keychain can be easily deleted via the UI or the security delete-keychain fastlane_tmp_keychain-db command.

Hope it helps.

Upvotes: 0

sbejga
sbejga

Reputation: 377

It happened for me as well and I found this thread. But the solution of André does not work for me, Delete action is grayed out and disabled in Edit menu.

But I found another solution to delete the keychain:

fastlane run delete_keychain name:fastlane_tmp_keychain-db

and set login keychain as default again:

security default-keychain -s ~/Library/Keychains/login.keychain-db

you may have to restart 'Keychain Access' to show changed default keychain

Upvotes: 22

JimmyDeemo
JimmyDeemo

Reputation: 333

Finally managed to get rid of if using the following. Add this to your fastlane file;

desc "delete created keychain"
   lane :delete_chain do
delete_keychain(name: "fastlane_tmp_keychain-db")
end

Then run sudo fastlane delete_chain. Note: This will (likely) destroy anything that has been saved into the keychain while it was considered the default. Therefore consider backing it up first.

Upvotes: 6

André
André

Reputation: 2290

Took me longer to figure out than I care to admit, so I'm documenting this here also for my own reference...

Open up Keychain Access, select the fastlane_tmp_keychain-db keychain on the left and then select Edit > Delete.

Delete Keychain

In the following dialog choose "Delete Keychain File" to permanently delete it.

Confirmation Dialog

This should fix it.

The fastlane_tmp_keychain-db shouldn't be there in the first place. It's temporary and supposed to be deleted automatically after the lane is executed. However, judging by the number of reports and questions on this topic lately, it seems to have broken recently. Deleting it should fix any issues you might have with your Mac and shouldn't affect your Fastlane project in any way.

Upvotes: 25

Related Questions