cmedina
cmedina

Reputation: 101

How do you create a .netrc file?

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>

Upvotes: 9

Views: 45978

Answers (2)

Moritz
Moritz

Reputation: 1790

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>

Upvotes: 4

IvanovDeveloper
IvanovDeveloper

Reputation: 602

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.

Upvotes: 22

Related Questions