9

I try to run my React Native project on MacBook Pro M1 but when I run adb it's gives error : zsh: segmentation fault adb.

I tried run adb from both ~/Library/Android/sdk/platform-tools & ~/usr/local/bin/adb.

Tried reinstall platform-tools in android studio.

Tried install and reinstall platform-tools from brew.

Tried reinstall android studio itself.

Device: MacBook Pro M1 2020, SSD: 512, RAM: 8

OS: macOS Monterey

Android Studio: android-studio-2021.1.1.21-mac_arm

Umamad
  • 551
  • 4
  • 10
  • 1
    I'm seeing the same issues since upgrading to build-tools 32.0.0. Google states "Known issue: this version crashes when run without any arguments." – Frederik Spang Feb 08 '22 at 13:58
  • yes it is. I explained for the error which I had, hop it can helps you too. – Umamad Feb 08 '22 at 16:08

4 Answers4

9

adb gives error but adb command works

enter image description here

Vihaan Verma
  • 12,815
  • 19
  • 97
  • 126
  • adb [1] 85820 segmentation fault adb adb --version Android Debug Bridge version 1.0.41 Version 32.0.0-8006631 Interesting, adb crashes but adding params make it work. – thachnb Feb 14 '22 at 16:27
  • Tnx to you, latest update solved the problem – Umamad Mar 02 '22 at 14:18
7

After install Android Studio create ready project using android studio's ready templates, then build the project. You will get error, ignore the error.

go to sdk manager then remove platform-tools and click apply button then click Ok and restart android studio.

again go to sdk manager then install platform-tools. go to the project and build it, build should be successful. run the project.

Now go to your React Native project and run for android. BOOM it up.

For physical device tests copy your final gradle to android studio and run it from android studio itself.

The zsh: segmentation fault adb still remains but you can run you're project on android emulator.

Google Says: "Pending and it will be ok at the next update"

Umamad
  • 551
  • 4
  • 10
0

Reinstalling Android SDK Platform-Tools solved the issue for me. Go to Android Studio > Settings > System Settings > Android SDK.

  • Click SDK Tools tab. Uncheck Android SDK Platform-Tools from the list. Click Apply to uninstall the package.
  • Check Android SDK Platform-Tools and click Apply to reinstall it.

Hope this helps.

offminded
  • 33
  • 1
  • 4
-1

This looks similar to your problem. Setting up android emulators on mac m1 pros requires extra installation steps.

Tarik
  • 537
  • 4
  • 9