Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

idb-companion installation fails on Mac M1 #649

Closed
jeffreyabarrios opened this issue Jan 27, 2021 · 53 comments
Closed

idb-companion installation fails on Mac M1 #649

jeffreyabarrios opened this issue Jan 27, 2021 · 53 comments

Comments

@jeffreyabarrios
Copy link

Description

I'm working on a Mac Mini M1, already installed fb-idb, but when trying to brew install idb-companion it fails all the time with the following error:

Screen Shot 2021-01-26 at 9 41 16 PM

Reproduction

brew install idb-companion / brew reinstall --build-from-source idb-companion

Solution

[OPTIONAL: Do you know what needs to be done to address this issue? Ideally, provide a pull request which fixes this issue.]

Additional Information

  • idb revision: [FILL THIS OUT]
@ericwu021
Copy link

Same error on my Mac M1 neither.

@kot10n5tn
Copy link

I also faced the same error.

@RnbWd
Copy link

RnbWd commented Feb 8, 2021

yup

@renatobentorocha
Copy link

Same here

@lander854
Copy link

same

1 similar comment
@kumarpatel
Copy link

same

@BrunoVillanova
Copy link

Any way to fix this issue?

@lucasapereira
Copy link

same here

@pwszebor
Copy link

pwszebor commented Mar 2, 2021

I managed to install idb_companion on a M1 Mac by installing x86_64 version of homebrew first and then using that to install idb_companion.

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
arch -x86_64 /usr/local/bin/brew tap Facebook/fb
arch -x86_64 /usr/local/bin/brew install idb-companion

@lumyjuwon
Copy link

@pwszebor Thanks !

@3DJakob
Copy link

3DJakob commented Mar 18, 2021

I managed to install idb_companion on a M1 Mac by installing x86_64 version of homebrew first and then using that to install idb_companion.

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
arch -x86_64 /usr/local/bin/brew tap Facebook/fb
arch -x86_64 /usr/local/bin/brew install idb-companion

Is this really a good solution? Is it possible to have both the arm version of brew and x86 version at the same time and if it is what possible side effects could that have?

@lucadegasperi
Copy link

I managed to install idb_companion on a M1 Mac by installing x86_64 version of homebrew first and then using that to install idb_companion.

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
arch -x86_64 /usr/local/bin/brew tap Facebook/fb
arch -x86_64 /usr/local/bin/brew install idb-companion

Is this really a good solution? Is it possible to have both the arm version of brew and x86 version at the same time and if it is what possible side effects could that have?

Wondering the same thing, is it possible to run two versions of homebrew side by side without any issues?

@pwszebor
Copy link

pwszebor commented Apr 1, 2021

No issues so far for me. The arm64 version is still the default, "which brew" points at it, it's installed in /opt/homebrew as opposed to Intel version which is in /usr/local/Homebrew.

@lucadegasperi
Copy link

I tried to install the x86_64 version of homebrew after I had the arm64 version already installed and the x86 version became the default one unlike what @pwszebor said. Guess I'll wait for an arm64 version of idb.

@xiaohuanxiong3
Copy link

same here

@Seanmclem
Copy link

Seanmclem commented Jun 11, 2021

got rosetta homebrew setup, it just fails at a brew-cask step now because apparently that package is gone ... script is outdated ... should be brew cask install ...

@hhhhjjj
Copy link

hhhhjjj commented Jun 16, 2021

same here

@tmirun
Copy link

tmirun commented Jun 25, 2021

Same Here

@andreluisjunqueira
Copy link

Same Here !

@rikur
Copy link

rikur commented Jul 18, 2021

Any updates on this?

@Ashoat
Copy link

Ashoat commented Jul 19, 2021

We were having trouble getting IDB to run in the M1 environment without Rosetta. However it seems to work well if you set up Homebrew with Rosetta, and then run the install via that!

@BrunoVillanova
Copy link

Yes, @Ashoat . You are totally right. We need to use this workaround for now.

@rikur
Copy link

rikur commented Jul 20, 2021

I had success installing idb-companion inside a x86 zsh and later installing fb-idb via pip3.

arch -x86_64 zsh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
/usr/local/bin/brew tap Facebook/fb
/usr/local/bin/brew install idb-companion

And then in a arm shell, I ran

pip3 install fb-idb

No idea how it works, but it does :)

Sources:
https://gist.github.com/progrium/b286cd8c82ce0825b2eb3b0b3a0720a0
#649 (comment)

@trK54Ylmz
Copy link

trK54Ylmz commented Oct 10, 2021

if you don't want to install brew with x86_64 architecture,

$ arch # arm64
$ git clone [email protected]:facebook/idb.git
$ cd idb
$ ./idb_build.sh idb_companion build /opt/homebrew
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBDeviceControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/XCTestBootstrap.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBControlCore.framework/Versions/A/Resources/libShimulator.dylib
$ idb_companion --version
> {"build_time":"12:32:07","build_date":"Oct 10 2021"}

then install idb,

$ pip3 install fb-idb
$ idb list-targets
> iPad (9th generation) .....

tested on Mac Mini 2020 M1

@robbiemccorkell
Copy link

This worked well for me, but also requires a pod install for the fresh repo clone:

$ arch # arm64
$ git clone [email protected]:facebook/idb.git
$ cd idb
$ pod install
$ ./idb_build.sh idb_companion build /opt/homebrew
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBDeviceControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/XCTestBootstrap.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBControlCore.framework/Versions/A/Resources/libShimulator.dylib
$ idb_companion --version
> {"build_time":"12:32:07","build_date":"Oct 10 2021"}

@jekoie
Copy link

jekoie commented Oct 18, 2021

This worked well for me, but also requires a pod install for the fresh repo clone:

$ arch # arm64
$ git clone [email protected]:facebook/idb.git
$ cd idb
$ pod install
$ ./idb_build.sh idb_companion build /opt/homebrew
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBDeviceControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/XCTestBootstrap.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBControlCore.framework/Versions/A/Resources/libShimulator.dylib
$ idb_companion --version
> {"build_time":"12:32:07","build_date":"Oct 10 2021"}

I follow your tips is failed?

jett@jmac idb % ./idb_build.sh idb_companion build /opt/homebrew
using target idb_companion
using command build
using output directory /opt/homebrew
objc[32108]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1f35afb78) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1149302c8). One of the two will be used. Which one is undefined.
objc[32108]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1f35afbc8) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x114930318). One of the two will be used. Which one is undefined.
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace idb_companion.xcworkspace -scheme idb_companion -sdk macosx -derivedDataPath build build

User defaults from command line:
    IDEDerivedDataPathOverride = /Users/jett/idb/build
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    SDKROOT = macosx11.3

note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Using build description from disk
note: Build preparation complete
Libtool /Users/jett/idb/build/Build/Products/Debug/gRPC-C++/libgRPC-C++.a normal (in target 'gRPC-C++' from project 'Pods')
    cd /Users/jett/idb/Pods
    export MACOSX_DEPLOYMENT_TARGET\=10.10
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only arm64 -D -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -L/Users/jett/idb/build/Build/Products/Debug/gRPC-C++ -filelist /Users/jett/idb/build/Build/Intermediates.noindex/Pods.build/Debug/gRPC-C++.build/Objects-normal/arm64/gRPC-C++.LinkFileList -dependency_info /Users/jett/idb/build/Build/Intermediates.noindex/Pods.build/Debug/gRPC-C++.build/Objects-normal/arm64/gRPC-C++_libtool_dependency_info.dat -o /Users/jett/idb/build/Build/Products/Debug/gRPC-C++/libgRPC-C++.a

PhaseScriptExecution Build\ Shimulators /Users/jett/idb/build/Build/Intermediates.noindex/FBSimulatorControl.build/Debug/FBControlCore.build/Script-71B9E0DA268C68A700D40A91.sh (in target 'FBControlCore' from project 'FBSimulatorControl')
    cd /Users/jett/idb
    /bin/sh -c /Users/jett/idb/build/Build/Intermediates.noindex/FBSimulatorControl.build/Debug/FBControlCore.build/Script-71B9E0DA268C68A700D40A91.sh
+ build_shim Shimulator /Users/jett/idb/Shims/Binaries
+ local shim_to_build=Shimulator
+ local shim_destination=/Users/jett/idb/Shims/Binaries
+ local build_log_mirror=/Users/jett/idb/build/Build/Intermediates.noindex/FBSimulatorControl.build/Debug/FBControlCore.build/Shimulator-build.log
+ xcodebuild -project Shims/Shimulator/Shimulator.xcodeproj -scheme Shimulator build
+ tee /Users/jett/idb/build/Build/Intermediates.noindex/FBSimulatorControl.build/Debug/FBControlCore.build/Shimulator-build.log

RuleScriptExecution /Users/jett/idb/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/idb.pb.h /Users/jett/idb/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/idb.pb.cc /Users/jett/idb/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/idb.grpc.pb.h /Users/jett/idb/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/idb.grpc.pb.cc /Users/jett/idb/proto/idb.proto normal arm64 (in target 'idbGRPC' from project 'idb_companion')
    cd /Users/jett/idb
    /bin/sh -c \#\ Generate\ grpc\ code\ from\ .proto'
'PATH\=\$PATH:/opt/homebrew/bin/:/usr/local/bin'
''
'protoc\ --proto_path\=\$INPUT_FILE_DIR\ --cpp_out\=\$DERIVED_FILE_DIR\ --grpc_out\=\$DERIVED_FILE_DIR\ --plugin\=protoc-gen-grpc\=\$\(brew\ --prefix\)/bin/grpc_cpp_plugin\ \$INPUT_FILE_PATH'
''
'\#\ Copy\ headers'
'mkdir\ -p\ \$\{BUILT_PRODUCTS_DIR\}/\$\{PRODUCT_NAME\}'
'cp\ -a\ \$\{DERIVED_FILES_DIR\}/\*.h\ \$\{BUILT_PRODUCTS_DIR\}/\$\{PRODUCT_NAME\}'
'
/bin/sh: line 3: protoc: command not found
cp: /Users/jett/idb/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/*.h: No such file or directory
Command RuleScriptExecution failed with a nonzero exit code

** BUILD FAILED **


The following build commands failed:
	RuleScriptExecution /Users/jett/idb/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/idb.pb.h /Users/jett/idb/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/idb.pb.cc /Users/jett/idb/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/idb.grpc.pb.h /Users/jett/idb/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/idb.grpc.pb.cc /Users/jett/idb/proto/idb.proto normal arm64
(1 failure)

@trK54Ylmz
Copy link

trK54Ylmz commented Oct 18, 2021

@jekoie I am not sure but I feel like GRPC and Protocol buffers is missing,

/bin/sh: line 3: protoc: command not found

cp: /Users/jett/idb/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/*.h: No such file or directory

Could you please try,

$ brew install protobuf 
$ brew install grpc

@LeonZXY
Copy link

LeonZXY commented Oct 25, 2021

I managed to install idb_companion on a M1 Mac by installing x86_64 version of homebrew first and then using that to install idb_companion.

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
arch -x86_64 /usr/local/bin/brew tap Facebook/fb
arch -x86_64 /usr/local/bin/brew install idb-companion

thx

@dan-abc
Copy link

dan-abc commented Nov 5, 2021

This worked well for me, but also requires a pod install for the fresh repo clone:

$ arch # arm64
$ git clone [email protected]:facebook/idb.git
$ cd idb
$ pod install
$ ./idb_build.sh idb_companion build /opt/homebrew
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBDeviceControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/XCTestBootstrap.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBControlCore.framework/Versions/A/Resources/libShimulator.dylib
$ idb_companion --version
> {"build_time":"12:32:07","build_date":"Oct 10 2021"}

I've followed these instructions but get the following compile error during the build:

/Users/Mac/Desktop/idb/FBControlCore/Management/FBiOSTarget.h:15:9: fatal error: > > > 'FBControlCore/FBDapServerCommands.h' file not found
#import <FBControlCore/FBDapServerCommands.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Mac/Desktop/idb/FBControlCore/Management/FBiOSTarget.h:15:9: note: did not find header 'FBDapServerCommands.h' in framework 'FBControlCore'
      (loaded from '/Users/Mac/Desktop/idb/build/Build/Products/Debug')
1 error generated.

Looks like there's a dep I'm not getting?

System is M1 Mac mini on macOS 12

@trK54Ylmz
Copy link

This worked well for me, but also requires a pod install for the fresh repo clone:

$ arch # arm64
$ git clone [email protected]:facebook/idb.git
$ cd idb
$ pod install
$ ./idb_build.sh idb_companion build /opt/homebrew
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBDeviceControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/XCTestBootstrap.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBControlCore.framework/Versions/A/Resources/libShimulator.dylib
$ idb_companion --version
> {"build_time":"12:32:07","build_date":"Oct 10 2021"}

I've followed these instructions but get the following compile error during the build:

/Users/Mac/Desktop/idb/FBControlCore/Management/FBiOSTarget.h:15:9: fatal error: > > > 'FBControlCore/FBDapServerCommands.h' file not found
#import <FBControlCore/FBDapServerCommands.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Mac/Desktop/idb/FBControlCore/Management/FBiOSTarget.h:15:9: note: did not find header 'FBDapServerCommands.h' in framework 'FBControlCore'
      (loaded from '/Users/Mac/Desktop/idb/build/Build/Products/Debug')
1 error generated.

Looks like there's a dep I'm not getting?

System is M1 Mac mini on macOS 12

I am not one of the maintainers but I think the header file has problem FBDapServerCommands.h#L18. It looks very normal to get that error @DShepherd

I think one of the tags should work, could you please try?

$ git clone [email protected]:facebook/idb.git
$ cd idb
$ git checkout v1.1.5
$ ./idb_build.sh idb_companion build /opt/homebrew
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBDeviceControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/XCTestBootstrap.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBControlCore.framework/Versions/A/Resources/libShimulator.dylib
$ idb_companion --version

@martinMMO
Copy link

I have the same issue (M1 Pro) as @DShepherd.

In file included from /Users/macbook/Documents/idb/FBControlCore/Commands/FBInstrumentsCommands.m:12:
/Users/macbook/Documents/idb/FBControlCore/Management/FBiOSTarget.h:15:9: fatal error: 'FBControlCore/FBDapServerCommands.h' file not found
#import <FBControlCore/FBDapServerCommands.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/macbook/Documents/idb/FBControlCore/Management/FBiOSTarget.h:15:9: note: did not find header 'FBDapServerCommands.h' in framework 'FBControlCore' (loaded from
      '/Users/macbook/Documents/idb/build/Build/Products/Debug')
1 error generated.

** BUILD FAILED **


The following build commands failed:
	CompileC /Users/macbook/Documents/idb/build/Build/Intermediates.noindex/FBSimulatorControl.build/Debug/FBControlCore.build/Objects-normal/arm64/FBInstrumentsOperation.o /Users/macbook/Documents/idb/FBControlCore/Utility/FBInstrumentsOperation.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'FBControlCore' from project 'FBSimulatorControl')

I also tried import, but it didn't help.

#import <FBControlCore/FBDapServerCommands.h>
#import <Foundation/Foundation.h>
#import <FBControlCore/FBProcess.h>
#import <FBControlCore/FBFuture.h>

@RuijieC-dev
Copy link

Issue has been solve with commit d339206.

@dan-abc
Copy link

dan-abc commented Nov 9, 2021

Issue has been solve with commit d339206.

Thanks! I successfully built with the latest commit.

@JohnPremKumar
Copy link

This worked well for me, but also requires a pod install for the fresh repo clone:

$ arch # arm64
$ git clone [email protected]:facebook/idb.git
$ cd idb
$ pod install
$ ./idb_build.sh idb_companion build /opt/homebrew
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBDeviceControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/XCTestBootstrap.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBControlCore.framework/Versions/A/Resources/libShimulator.dylib
$ idb_companion --version
> {"build_time":"12:32:07","build_date":"Oct 10 2021"}

This worked thanks

@mxmzb
Copy link

mxmzb commented Jan 4, 2022

Issue has been solve with commit d339206.

Can we release a new version with the commit that fixes this, please?

@Ashoat
Copy link

Ashoat commented Jan 4, 2022

@mxmzb – Does brew install --HEAD idb-companion work for you? If not, then a new version won't help. The problem is that even though this issue (#649) was solved with d339206, M1 support was quickly broken again after. #747 tracks the new issue.

@mxmzb
Copy link

mxmzb commented Jan 4, 2022

The problem is that even though this issue (#649) was solved with d339206, M1 support was quickly broken again after.

This explains why I'm having trouble. Let me check, and thank you!

@kklobe
Copy link

kklobe commented Jan 8, 2022

I was able to build off commit 7762446 on my M1 by installing gRPC and updating the Podfile tags for pod 'Protobuf-C++' to match my protoc version (which comes from conda on my system via the pip3 install fb-idb step):

$ brew install grpc
$ protoc --version
libprotoc 3.18.1

updated Podfile:

workspace 'idb_companion'

platform :macos, '10.14'

project 'idb_companion'

target 'idb_companion' do
  pod 'gRPC-C++'
  pod 'gRPC-C++/Protobuf'
  pod 'Protobuf-C++',  :git => 'https://github.com/google/protobuf.git', :tag => 'v3.18.1'
end

target 'idbGRPC' do
  pod 'Protobuf-C++',  :git => 'https://github.com/google/protobuf.git', :tag => 'v3.18.1'
end

and then pod install and ./idb_build.sh idb_companion build /opt/homebrew gave me an M1-native working Flipper.

@keeprock
Copy link

keeprock commented Jan 18, 2022

@kklobe Tried your approach - didn't work for me for some reason. And I've tried my best.

Does your Flipper run on Apple arch now?

@kklobe
Copy link

kklobe commented Jan 18, 2022

@keeprock yes (I am building Flipper locally with no source changes, just an Electron version bump). I just updated to the latest commit there and everything is still working.

CleanShot 2022-01-18 at 06 56 29@2x

@plasticrake
Copy link

I got it working using @kklobe's instructions but I had to run pod install before ./idb_build.sh idb_companion build /opt/homebrew. Thank you @kklobe!

@kklobe
Copy link

kklobe commented Jan 19, 2022

I got it working using @kklobe's instructions but I had to run pod install before ./idb_build.sh idb_companion build /opt/homebrew. Thank you @kklobe!

Thanks @plasticrake, I updated my comment to make the pod install explicit. Glad you got it working!

@horsewin
Copy link

i failed to install by the version of libprotoc 3.17.3, but working well by using libprotoc 3.19.3.
Thanks a lot @kklobe!!

@keeprock
Copy link

keeprock commented Jan 28, 2022

@kklobe Thanks!

I've been able to build a Flipper for M1. This is how I did it:

  • Git cloned Flipper repo
  • Checked-out a commit with the latest release tag (I did 0.131.0, you can do any if you want to)
  • Cherry-picked this PR Update electron to v16 flipper#3355
  • When went here and applied changes to desktop/scripts/build-release.ts

libprotoc version is 3.18.1

image

@preshonyee
Copy link

preshonyee commented Jan 28, 2022

if you don't want to install brew with x86_64 architecture,

$ arch # arm64
$ git clone [email protected]:facebook/idb.git
$ cd idb
$ ./idb_build.sh idb_companion build /opt/homebrew
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBDeviceControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBSimulatorControl.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/XCTestBootstrap.framework/Versions/A/Resources/libShimulator.dylib
$ codesign --force --sign - --timestamp=none /opt/homebrew/Frameworks/FBControlCore.framework/Versions/A/Resources/libShimulator.dylib
$ idb_companion --version
> {"build_time":"12:32:07","build_date":"Oct 10 2021"}

then install idb,

$ pip3 install fb-idb
$ idb list-targets
> iPad (9th generation) .....

tested on Mac Mini 2020 M1

this worked for me February 2022.
To be sure its installed, run which idb to show the path it is installed in

@vzenzo
Copy link

vzenzo commented Feb 10, 2022

None of these solutions work for me on M1 :(

@fortmarek
Copy link

These steps works for me, however, only after I also ran brew install protobuf grpc - otherwise, the command ./idb_build.sh idb_companion build /opt/homebrew would fail as the internal Xcode project relies on a couple of binaries installed. Unfortunately, it's not too obvious from xcodebuild's output but I recommend opening the project in Xcode and try to build the idb_companion executable there.

@hbnordin2
Copy link

@fortmarek steps are working for me.

@JaredDanilson
Copy link

This worked for me as well. protobuf did not link correctly when I ran brew install protobuf, so I had to run sudo chown -R $(whoami) $(brew --prefix)/* and brew link --overwrite protobuf. After that no issues building idb_companion.

@jbardini
Copy link
Contributor

jbardini commented Mar 3, 2022

Build on M1 has been fixed on idb-companion v1.1.7. A arm64_monterey bottle was also published.

@jbardini jbardini closed this as completed Mar 3, 2022
@AbdJazmawi
Copy link

best way to do it:
use pip or pip3 to install idb.
I used pip3 install fb-idb.
then which idb it returned opt/homebrew/bin/idb
this way flipper recognize it

@Diptags
Copy link

Diptags commented Jun 1, 2024

I also had this problem on the Mac M1 Pro. For me, I am using Homebrew to install the idb-companion. I did this:

Install idb-companion First

brew tap facebook/fb
brew install idb-companion

Symlink the idb-companion from homebrew to the correct location for Flipper:
sudo ln -s /opt/homebrew/bin/idb-companion /usr/local/bin/idb-companion

Install idb CLI tool to interact with the idb-companion (Sudo is a must)
sudo pip3 install --user fb-idb --break-system-packages

Check the idb installation
which idb

Symlink the idb from homebrew to the correct location for Flipper:
sudo ln -s /opt/homebrew/bin/idb /usr/local/bin/idb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests