3
votes

I'm attempting to download the Mapbox Maps SDK for ios but I'm having trouble understanding how to create a .netrc file. I'm supposed to store my secret token to download the SDK and I can't add the SDK dependency with Cocoapods until I do this first. Anyone know how to go about this?

Here's the installation page for reference.

https://docs.mapbox.com/ios/maps/guides/install/#add-the-dependency

The format for the .netrc file is as follows:

machine api.mapbox.com
login mapbox
password <INSERT SECRET API TOKEN>

Thank you in advance!

2

2 Answers

3
votes

Instruction how to install Mapbox into you system

If you have problems with installation Mapbox regarding official guide https://docs.mapbox.com/ios/maps/guides/install/

You can use next tips.


To create .netrc file do next

  1. Fire up Terminal
  2. cd ~ (go to the home directory)
  3. touch .netrc (create file)
  4. open .netrc (open .netrc)
  5. Set required data.
  6. Save

.netrc file should be like this

machine api.mapbox.com
login mapbox
password <secret_key_created_from_your_mapbox_account>

If you created .netrc file regarding this instruction, mapbox cocoapods should install.

1
votes

CD to $HOME directory

$ cd ~

Create .netrc file

$ vi .netrc

Then use vi or any other editor and change the content of the file .netrc to

machine api.mapbox.com
login mapbox
password <YOUR SECRET TOKEN>

Make sure to replace <YOUR SECRET TOKEN>