proxmark3/doc/md/Installation_Instructions/Mac-OS-X-Homebrew-Installation-Instructions.md

201 lines
8 KiB
Markdown
Raw Normal View History

2021-12-31 18:36:43 +08:00
<a id="Top"></a>
# Mac OS X - Homebrew automatic installation
# Table of Contents
- [Mac OS X - Homebrew automatic installation](#mac-os-x---homebrew-automatic-installation)
- [Table of Contents](#table-of-contents)
- [macOS Ventura Beta users](#macos-ventura-beta-users)
2021-12-31 18:36:43 +08:00
- [Apple Silicon (M1) Notes](#apple-silicon-m1-notes)
- [Install Proxmark3 tools](#install-proxmark3-tools)
- [Upgrade HomeBrew tap formula](#upgrade-homebrew-tap-formula)
- [Flash the BOOTROM & FULLIMAGE](#flash-the-bootrom--fullimage)
- [Run the client](#run-the-client)
- [Next steps](#next-steps)
- [Homebrew (Mac OS X), developer installation](#homebrew-mac-os-x-developer-installation)
- [Clone the Iceman repository](#clone-the-iceman-repository)
- [Compile the project](#compile-the-project)
- [the button trick](#the-button-trick)
- [Run it](#run-it)
2021-12-31 18:36:43 +08:00
2019-08-21 03:30:43 +08:00
## macOS Ventura Beta users
^[Top](#top)
Users of macOS Ventura Beta can no longer use Xcode versions lower than 14.0. (*Technically* they can by `Show Package Contents` and running `/Contents/MacOS/Xcode` but this is not recommended or recognized by Brew installations)
Therefore you need to download Xcode 14.0 Beta and open it to install the correct Command Line Tools. (https://developer.apple.com/download/all/)
Important: you need to rename `Xcode-beta.app` to `Xcode.app` (Note: If you still need Xcode 13.0 for signing and uploading apps to App Store rename `Xcode.app` to `Xcode-2.app`).
Continue installation as detailed below.
2021-01-04 08:27:20 +08:00
## Apple Silicon (M1) Notes
2021-12-31 18:36:43 +08:00
^[Top](#top)
2021-01-04 08:27:20 +08:00
Ensure Rosetta 2 is installed as it's currently needed to run `arm-none-eabi-gcc` as it's delivered as a precombiled x86_64 binary.
If you see an error like:
```sh
bad CPU type in executable
```
Then you are missing Rosetta 2 and need to install it: `/usr/sbin/softwareupdate --install-rosetta`
2021-12-31 18:36:43 +08:00
Homebrew has changed their prefix to differentiate between native Apple Silicon and Intel compiled binaries. The Makefile attempts to account for this but please note that
whichever terminal or application you're using must be running under Architecture "Apple" as seen by Activity Monitor as all child processes inherit the Rosetta 2 environment of their parent. You can check which architecture you're currently running under with a `uname -m` in your terminal.
2021-01-04 08:27:20 +08:00
Visual Studio Code still runs under Rosetta 2 and if you're developing for proxmark3 on an Apple Silicon Mac you might want to consider running the Insiders build which has support for running natively on Apple Silicon.
2019-08-21 03:30:43 +08:00
## Install Proxmark3 tools
2021-12-31 18:36:43 +08:00
^[Top](#top)
2019-08-21 03:30:43 +08:00
2021-06-11 19:42:13 +08:00
These instructions comes from \@Chrisfu, where we got the proxmark3.rb scriptfile from.
For further questions about Mac & Homebrew, contact [\@Chrisfu on Twitter](https://github.com/chrisfu/)
2022-03-20 16:34:36 +08:00
0. Install XCode Command Line Tools if you haven't yet already done so:
- `xcode-select --install`
2022-03-20 16:34:36 +08:00
1. Install homebrew if you haven't yet already done so:
- http://brew.sh/
2021-06-11 19:42:13 +08:00
2022-03-20 16:34:36 +08:00
2. Install xquartz:
- `brew install xquartz`
3. Tap this repo:
- `brew tap RfidResearchGroup/proxmark3`
2022-02-27 19:27:12 +08:00
2022-03-20 16:34:36 +08:00
4. Install Proxmark3:
- `brew install proxmark3` for stable release
- `brew install --HEAD proxmark3` for latest non-stable from GitHub (use this if previous command fails)
2020-04-17 03:25:30 +08:00
- `brew install --with-blueshark proxmark3` for blueshark support, stable release
- `brew install --HEAD --with-blueshark proxmark3` for blueshark support, latest non-stable from GitHub (use this if previous command fails)
- `brew install --with-generic proxmark3`: for generic (non-RDV4) devices ([platform](https://github.com/RfidResearchGroup/proxmark3/blob/master/doc/md/Use_of_Proxmark/4_Advanced-compilation-parameters.md#platform)), stable release
- `brew install --HEAD --with-generic proxmark3`: for generic (non-RDV4) devices ([platform](https://github.com/RfidResearchGroup/proxmark3/blob/master/doc/md/Use_of_Proxmark/4_Advanced-compilation-parameters.md#platform)), latest non-stable from GitHub (use this if previous command fails)
For more info, go to https://github.com/RfidResearchGroup/homebrew-proxmark3
2019-08-21 03:30:43 +08:00
## Upgrade HomeBrew tap formula
2021-12-31 18:36:43 +08:00
^[Top](#top)
2019-05-06 01:53:58 +08:00
2022-02-27 00:15:32 +08:00
*This method is useful for those looking to run bleeding-edge versions of iceman's fork. Keep this in mind when attempting to update your HomeBrew tap formula as this procedure could easily cause a build to break if an update is unstable on macOS.*
Tested on macOS Mojave 10.14.4
2022-02-27 00:15:32 +08:00
*Note: This assumes you have already installed iceman's fork from HomeBrew as mentioned above*
2019-05-06 01:53:58 +08:00
Force HomeBrew to pull the latest source from github
```sh
brew upgrade --fetch-HEAD proxmark3
2019-05-06 01:53:58 +08:00
```
## Flash the BOOTROM & FULLIMAGE
2021-12-31 18:36:43 +08:00
^[Top](#top)
2019-05-06 01:53:58 +08:00
With your Proxmark3 unplugged from your machine, press and hold the button on your Proxmark3 as you plug it into a USB port. You can release the button, two of the four LEDs should stay on. You're in bootloader mode, ready for the next step. In case the two LEDs don't stay on when you're releasing the button, you've an old bootloader, start over and keep the button pressed during the whole flashing procedure.
2019-09-04 04:54:42 +08:00
In principle, the helper script `pm3-flash-all` should auto-detect your port, so you can just try:
```sh
2019-09-04 04:54:42 +08:00
pm3-flash-all
```
2019-09-04 04:54:42 +08:00
If port detection failed, you'll have to call the flasher manually and specify the correct port:
2019-09-04 04:54:42 +08:00
```sh
2019-09-09 07:54:59 +08:00
proxmark3 /dev/tty.usbmodemiceman1 --flash --unlock-bootloader --image /usr/local/share/proxmark3/firmware/bootrom.elf --image /usr/local/share/proxmark3/firmware/fullimage.elf
2019-09-04 04:54:42 +08:00
```
2022-03-20 16:34:36 +08:00
> Depending on the firmware version your Proxmark3 can also appear as:
> `/dev/tty.usbmodem881`
When compiling and you didn't flash the device, the client will now warn that you have a full image that doesn't match the source code of your client. If you know what you are doing, you can ignore it.
2019-05-06 01:53:58 +08:00
2019-05-06 01:53:58 +08:00
## Run the client
2021-12-31 18:36:43 +08:00
^[Top](#top)
2019-05-06 01:53:58 +08:00
```sh
2019-09-04 04:54:42 +08:00
pm3
```
or, if the port doesn't get properly detected:
```sh
proxmark3 /dev/tty.usbmodemiceman1
2019-05-06 01:53:58 +08:00
```
## Next steps
2021-12-31 18:36:43 +08:00
^[Top](#top)
2019-05-06 01:53:58 +08:00
For the next steps, please read the following pages:
* [Validating proxmark client functionality](/doc/md/Use_of_Proxmark/1_Validation.md)
* [First Use and Verification](/doc/md/Use_of_Proxmark/2_Configuration-and-Verification.md)
* [Commands & Features](/doc/md/Use_of_Proxmark/3_Commands-and-Features.md)|
2019-08-21 03:30:43 +08:00
# Homebrew (Mac OS X), developer installation
2021-12-31 18:36:43 +08:00
^[Top](#top)
2019-08-21 03:30:43 +08:00
These instructions will show how to setup the environment on OSX to the point where you'll be able to clone and compile the repo by yourself, as on Linux, Windows, etc.
1. Install homebrew if you haven't yet already done so: http://brew.sh/
2. Install dependencies:
```
2022-02-27 19:27:12 +08:00
brew install readline qt5 pkgconfig coreutils
2019-08-21 03:30:43 +08:00
brew install RfidResearchGroup/proxmark3/arm-none-eabi-gcc
```
3. (optional) Install makefile dependencies:
```
brew install recode
brew install astyle
```
# Clone the Iceman repository
2021-12-31 18:36:43 +08:00
^[Top](#top)
2019-08-21 03:30:43 +08:00
```sh
git clone https://github.com/RfidResearchGroup/proxmark3.git
cd proxmark3
2019-08-21 03:30:43 +08:00
```
## Compile the project
^[Top](#top)
2019-09-10 01:55:55 +08:00
Now you're ready to follow the [compilation instructions](/doc/md/Use_of_Proxmark/0_Compilation-Instructions.md).
From there, you can follow the original compilation instructions.
_Take extra note to instructions if you don't have a Proxmark3 RDV4 device._
2019-08-21 03:30:43 +08:00
2019-09-10 01:55:55 +08:00
To flash on OS X, better to enter the bootloader mode manually, else you may experience errors.
### the button trick
^[Top](#top)
2022-03-20 17:14:46 +08:00
2019-09-10 01:55:55 +08:00
With your Proxmark3 unplugged from your machine, press and hold the button on your Proxmark3 as you plug it into a USB port. You can release the button, two of the four LEDs should stay on. You're in bootloader mode, ready for the next step. In case the two LEDs don't stay on when you're releasing the button, you've an old bootloader, start over and keep the button pressed during the whole flashing procedure.
## Run it
^[Top](#top)
2022-03-20 17:14:46 +08:00
To use the compiled client, you can use `pm3` script, it is a wrapper of the proxmark3 client that handles automatic detection of your proxmark.
```sh
pm3
```
If you want to manually select serial port, remember that the Proxmark3 port is `/dev/tty.usbmodemiceman1`, so commands become:
```sh
proxmark3 /dev/ttyACM0 => proxmark3 /dev/tty.usbmodemiceman1
```