Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

IDB: Current setting isn't a valid IDB installation #3126

Open
seyaobey-dev opened this issue Dec 4, 2021 · 23 comments
Open

IDB: Current setting isn't a valid IDB installation #3126

seyaobey-dev opened this issue Dec 4, 2021 · 23 comments

Comments

@seyaobey-dev
Copy link

🐛 Bug Report

Apologies, this may not be a bug per se but I could not find any forum or other place where I can find help. This is the first time for me using Flipper. After having followed the instructions, I was able to install Flipper on my Macbook air M1 (2020) Monterey.
When I open "Setup Doctor", everything is green except a warning with IDB:

IDB is required to use Flipper with IOS devices. (...)
Current settings:
/Library/Frameworks/Python.framework/Versions/3.10/bin isn't a valid IDB installation.

I followed the instructions on this repository and also on facebook IDB page.

To Reproduce

Install Flipper according to instructions
Install facebook IDB companion and client

Environment

OS: MacOS Monterey 12.0.1, Chip Apple M1
Flipper version: 0.123.0 (50.0.0)
Android Studio Artic Fox 2020.3.1 Patch 3
XCode 13.2 beta 2

@lblasa
Copy link
Contributor

lblasa commented Dec 7, 2021

@seyaobey-dev many thanks for reaching out.

That doesn't seem the path to the idb binary. On macOS, can you please execute this on the terminal:
which idb

That'll print out the path to idb. Copy the value and set it into Flipper -> Settings.

For example, this is a valid path for idb:
/usr/local/bin/idb

@seyaobey-dev
Copy link
Author

@Iblasa thank you so much for your answer. Here is the output of the command which idb:

/Library/Frameworks/Python.framework/Versions/3.10/bin/idb

Screenshot at Dec 10 19-22-08

@seyaobey-dev
Copy link
Author

Also which pip3 returns:

/Library/Frameworks/Python.framework/Versions/3.10/bin/pip3

@mweststrate
Copy link
Contributor

Please make sure the IDB setting ends with /idb and restart Flipper. Is the file readable by flipper and executable? use ll /Library/Frameworks/Python.framework/Versions/3.10/bin/idb to verify

@Pyroboomka
Copy link

Pyroboomka commented Dec 16, 2021

@seyaobey-dev what was your steps installing idb on you mac? I'm kinda lost in the "make sure to install everything through homebrew" on m1 mac to keep stuff working.

For me
brew tap facebook/fb brew install idb-companion

fails with

==> Installing facebook/fb/idb-companion
==> pod install
==> ./idb_build.sh idb_companion build /opt/homebrew/Cellar/idb-companion/1.1.5
Last 15 lines from /Users/*****/Library/Logs/Homebrew/idb-companion/02.idb_build.sh:
'
/bin/sh: line 3: protoc: command not found
cp: /tmp/idb-companion-20211217-90921-1qolsbx/idb-1.1.5/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

WriteAuxiliaryFile /tmp/idb-companion-20211217-90921-1qolsbx/idb-1.1.5/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/Objects-normal/arm64/idbGRPC.LinkFileList (in target 'idbGRPC' from project 'idb_companion')
    cd /tmp/idb-companion-20211217-90921-1qolsbx/idb-1.1.5
    write-file /tmp/idb-companion-20211217-90921-1qolsbx/idb-1.1.5/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/Objects-normal/arm64/idbGRPC.LinkFileList

** BUILD FAILED **

And i'm kinda lost at here.

EDIT:
activated a few more braincells, tried to brew install protobuf, now it fails with another error

Last 15 lines from /Users/dseb/Library/Logs/Homebrew/idb-companion/02.idb_build.sh:
Libtool /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Products/Debug/libPods-idb_companion.a normal (in target 'Pods-idb_companion' from project 'Pods')
    cd /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/Pods
    export MACOSX_DEPLOYMENT_TARGET\=10.14
    /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/MacOSX12.0.sdk -L/tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Products/Debug -L/tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Products/Debug/BoringSSL-GRPC -L/tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Products/Debug/Protobuf-C++ -L/tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Products/Debug/abseil -L/tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Products/Debug/gRPC-C++ -L/tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Products/Debug/gRPC-Core -filelist /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Intermediates.noindex/Pods.build/Debug/Pods-idb_companion.build/Objects-normal/arm64/Pods-idb_companion.LinkFileList -dependency_info /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Intermediates.noindex/Pods.build/Debug/Pods-idb_companion.build/Objects-normal/arm64/Pods-idb_companion_libtool_dependency_info.dat -o /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Products/Debug/libPods-idb_companion.a

Ld /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Products/Debug/FBControlCore.framework/Versions/A/FBControlCore normal (in target 'FBControlCore' from project 'FBSimulatorControl')
    cd /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-macos10.14 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -L/tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Products/Debug -F/tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Products/Debug -F/Applications/Xcode.app/Contents/Developer/../Frameworks -F/Applications/Xcode.app/Contents/Developer/../PlugIns -F/Applications/Xcode.app/Contents/Developer/../OtherFrameworks -F/Applications/Xcode.app/Contents/Developer/../SharedFrameworks -F/Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/Library/PrivateFrameworks -F/Library/Developer/PrivateFrameworks -filelist /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Intermediates.noindex/FBSimulatorControl.build/Debug/FBControlCore.build/Objects-normal/arm64/FBControlCore.LinkFileList -install_name @rpath/FBControlCore.framework/Versions/A/FBControlCore -Xlinker -rpath -Xlinker @executable_path -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -object_path_lto -Xlinker /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Intermediates.noindex/FBSimulatorControl.build/Debug/FBControlCore.build/Objects-normal/arm64/FBControlCore_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -framework Foundation -framework Cocoa -framework CoreGraphics -framework ServiceManagement -framework CoreMedia -Xlinker -no_adhoc_codesign -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Intermediates.noindex/FBSimulatorControl.build/Debug/FBControlCore.build/Objects-normal/arm64/FBControlCore_dependency_info.dat -o /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Products/Debug/FBControlCore.framework/Versions/A/FBControlCore

** BUILD FAILED **


The following build commands failed:
	RuleScriptExecution /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/idb.pb.h /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/idb.pb.cc /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/idb.grpc.pb.h /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/build/Build/Intermediates.noindex/idb_companion.build/Debug/idbGRPC.build/DerivedSources/idb.grpc.pb.cc /tmp/idb-companion-20211217-48935-1gibx8q/idb-1.1.5/proto/idb.proto normal arm64 (in target 'idbGRPC' from project 'idb_companion')
(1 failure)

which is kinda dead-end for me since not even an error message is present.

@grean
Copy link

grean commented Jan 3, 2022

It seems that idb is not installed in this path /usr/local/bin/idb when using this command:
pip3.10 install fb-idb
Maybe pip3.6 accordingly to the documentation doesn't install in the same way..

@vipin04
Copy link

vipin04 commented Aug 30, 2022

I am using python 3.10
I moved idb from /Library/Frameworks/Python.framework/Versions/3.10/bin to /usr/local/bin
Now after giving idb location as /usr/local/bin/idb is flipper settings, idb is getting detected properly.

@RichardFevrier
Copy link

You should not have to move anything...
If idb is accessible from your $PATH it should be used and not be hard coded to /usr/local/bin/idb...

@gavrilikhin-d
Copy link

gavrilikhin-d commented Apr 11, 2023

Have absolutely the same issue, except cp /Library/Frameworks/Python.framework/Versions/3.10/bin/idb /usr/local/bin doesn't help

@gavrilikhin-d
Copy link

idb installed with python is not a binary but python's shell script.

#!/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10
# -*- coding: utf-8 -*-
import re
import sys
from idb.cli.main import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

@gavrilikhin-d
Copy link

gavrilikhin-d commented Apr 11, 2023

Temporary workaround:

  1. pip install pyinstaller
  2. pyinstaller -F `which idb`
  3. sudo mv ./dist/idb /usr/local/bin/idb

This will create real executable file from python script, which may be used by flipper.

You may also need sudo cp /opt/homebrew/bin/idb_companion /usr/local/bin/idb_companion

@gavrilikhin-d
Copy link

@mweststrate could you update installation steps for new python versions?

@jnunes-ds
Copy link

I was heaving the same error, and the @gavrilikhin-d solution works for me. But the Flipper still don't recognize my ios device and I can't debug my application. Anyone having the same error?
Note: "No Application Selected" is the error I'm getting here.

@Jefid
Copy link

Jefid commented Nov 30, 2023

I spent a lot of time troubleshooting this myself. Turns out all I had to do was go into the Flipper settings, and change the "IDB binary location" to match the location given when you run which idb

In my case I had to change the location to "/Users/my-username/.pyenv/idb"

With the amount of people that report having issues with installing idb to use Flipper, it blows my mind that this solution isn't included anywhere in the Flipper Installation guide.

@RichardFevrier
Copy link

Again, if it's in your PATH nothing should be added in the documentation and it should work properly.

@SeanDunford
Copy link

Again, if it's in your PATH nothing should be added in the documentation and it should work properly.

At first i was unable to get idb in my path using the default instructions. I needed to run both

  • pip3 uninstall fb-idb
  • sudo pip3 install fb-idb

Based off of facebook/idb#620

I'd prefer not to run this command as sudo but not sure of another workaround atm.

WARNING: The directory '/Users/seandunford/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Collecting fb-idb
  Downloading fb_idb-1.1.7-py3-none-any.whl (149 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 149.7/149.7 kB 4.3 MB/s eta 0:00:00
Requirement already satisfied: aiofiles in /usr/local/lib/python3.11/site-packages (from fb-idb) (23.2.1)
Requirement already satisfied: grpclib>=0.4.0 in /usr/local/lib/python3.11/site-packages (from fb-idb) (0.4.6)
Requirement already satisfied: protobuf in /usr/local/lib/python3.11/site-packages (from fb-idb) (4.21.12)
Requirement already satisfied: treelib in /usr/local/lib/python3.11/site-packages (from fb-idb) (1.7.0)
Requirement already satisfied: h2<5,>=3.1.0 in /usr/local/lib/python3.11/site-packages (from grpclib>=0.4.0->fb-idb) (4.1.0)
Requirement already satisfied: multidict in /usr/local/lib/python3.11/site-packages (from grpclib>=0.4.0->fb-idb) (6.0.4)
Requirement already satisfied: six in /usr/local/lib/python3.11/site-packages (from treelib->fb-idb) (1.16.0)
Requirement already satisfied: hyperframe<7,>=6.0 in /usr/local/lib/python3.11/site-packages (from h2<5,>=3.1.0->grpclib>=0.4.0->fb-idb) (6.0.1)
Requirement already satisfied: hpack<5,>=4.0 in /usr/local/lib/python3.11/site-packages (from h2<5,>=3.1.0->grpclib>=0.4.0->fb-idb) (4.0.0)
Installing collected packages: fb-idb
Successfully installed fb-idb-1.1.7
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Installing with sudo did add to my path and flipper worked correctly after that.

@alioshr
Copy link

alioshr commented Dec 27, 2023

I just created a symbolic link to the current path, so I can keep it under homebrew:

~ which idb
-> /opt/homebrew/bin/idb

Then I did this:

ln -s /opt/homebrew/bin/idb /usr/local/bin/idb

Done =)

@LukaBabunadze
Copy link

ln -s /opt/homebrew/bin/idb /usr/local/bin/idb

This worked for me...

Thanks!

@Jefid
Copy link

Jefid commented Feb 22, 2024

Once again asking devs to add a section in the troubleshooting docs about this because this is a common issue. Linking to the idb docs that link to non-existent pip install docs isn't very intuitive.

@daibergm
Copy link

daibergm commented May 1, 2024

I used /Users/$user/Library/Python/3.9/bin/idb and it works for me

@halilertekin
Copy link

Screenshot 2024-06-13 at 18 06 22
Not working

@summerkiflain
Copy link

Screenshot 2024-07-11 at 2 14 08 PM
Facing issue on Mac Silicon using Flipper 0.257.0

@ziishaned
Copy link

I had to run the below command to resolve the issue for simulators are available

sudo ln -s /opt/homebrew/bin/idb_companion /usr/local/bin/idb_companion

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

No branches or pull requests