How do you create a .netrc file?
Asked Answered
B

2

9

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>
Bewhiskered answered 14/2, 2021 at 22:35 Comment(0)
A
21

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.

Aerograph answered 10/4, 2021 at 19:13 Comment(0)
I
4

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>

Irreplaceable answered 19/2, 2021 at 11:6 Comment(1)
Thank you! It says I have an existing file. If I press (R) to recover it and then copy and paste the information above, how do I save the terminal to reflect these changes? Thank you for your incredibly helpful information!Bewhiskered

© 2022 - 2024 — McMap. All rights reserved.