Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use the API tokens with Xcode?

allenu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 21, 2025

I am unable to use the API token when configuring my Bitbucket Cloud account in Xcode. I was able to successfully create an API token but when I paste it into Xcode as the Password field for my account, I get an error that "Your account or password is incorrect". I was able to use the App Passwords just fine with Xcode but the API token doesn't work.

Can you help me get this working?

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 27, 2025

G'day Allen!

 

To start using API tokens - you'll need to create the API token and specify the scope - this is mentioned in our deprecation documentation:

  1. Click the gear cog icon, select Atlassian Account settings > Security tab > Create and manage API Tokens

  2. Click Create API token with scopes and select Bitbucket Cloud

  3. If you want to be able to clone/push/pull to the repository - you'll need to tick both read:repository:bitbucket and write:repository:bitbucket - clone only would just be read:repository:bitbucket. More information on scopes can be found in our API scopes documentation.

  4. Perform the clone using the API token by updating the remote URL in Xcode to either of the formats below - it should use Basic auth:


If you're still unable to use the API token, I'd recommend reaching out to the Xcode forums for further support:

 

Cheers!

- Ben (Bitbucket Cloud Support)

Matej Malesevic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 20, 2025

Hi @Ben 

I'm facing probably the same issue as @allenu does... it's not the cloning thats the problem rather the authentication in Xcode itself. 

For example when adding a SPM Package hosted on a private bitbucket repository you have to authenticate somehow. Previously this was possible via App Passwords and this functionality unfortunatelly seems to be no longer available on bitbucket.org. 
I've tried several ways mentioned above... using https://token:APIToken@bitbucket.org/bla/bla or https://username:token@bitbucket.org did not work. 
In Xcode there is an option, to add a bitbucket server with an api token but this did not work neither. No matter what credentials i added in there i get the response "too many HTTP redirects". 

TL;DR; it is currently not possible to get Swift Packages in Xcode Projects working or have you been able to solve the issue @allenu

Like Jeremias Nunez likes this
Jeremias Nunez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 2, 2025

Hey guys, this will also be a breaking change for us :/ We distribute a few SDKs through SPM using https://username:token@bitbucket.org/ format URLs to authenticate in Xcode.

If this doesn't work anymore, what's the alternative?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events