facebook / idb

idb is a flexible command line interface for automating iOS simulators and devices
https://fbidb.io
MIT License
4.55k stars 436 forks source link

How to install this? #604

Open violet-athena opened 4 years ago

violet-athena commented 4 years ago

Description

How am I supposed to install this? The installation instructions are beyond insufficient. I did the brew install and the pip install and I still have no idb in my PATH. I have idb_companion in /usr/local/bin/, but apparently that's not the same. Can someone shed more light on this, please?

Reproduction

Follow the installation instructions, installation is not compleated.

c-ryan747 commented 4 years ago

pip3.7 install fb-idb will install idb to /opt/homebrew/bin/idb

violet-athena commented 4 years ago

Unfortunately, it didn't, had to manually symlink it. This should be added to the docs and if it's supposed to symlink this is a bug in the install script.

c-ryan747 commented 4 years ago

Can you run this and post the output? It creates /opt/homebrew/bin/idb for me

pip3.7 uninstall fb-idb
pip3.7 install fb-idb -v 
giovanicascaes commented 4 years ago

@daniocean Try running as root (sudo pip3.7 install fb-idb). It should install on /usr/local/bin/idb.

hsavit1 commented 4 years ago

The first time I ran the sudo command, it failed. You can tell if the network request doesn't show a loading bar. I then uninstalled via pip3.7 uninstall fb-idb , then ran sudo pip3.7 install fb-idb again and it worked

hsavit1 commented 4 years ago

However, I still don't know where this lives in my path. I don't see it in /opt/homebrew/bin/idb

EDIT: it's in /usr/local/Cellar/idb-companion

sy1vain commented 4 years ago

Running sudo -H pip3.7 install fb-idb worked for me

azuxx commented 4 years ago

I am still having the issue. Here's the following screenshots by steps: 1)

1

2)

2

3)

3

4) This neither

4

Any other suggestion?🙏🏻

Fengzhiwuyu commented 4 years ago

python3 --version Python 3.7.3 Use pip3.7, don't use pip3 Running sudo pip3 install fb-idb failed. Running sudo pip3.7 install fb-idb success.

thiagodelgado111 commented 4 years ago

Uninstalling and sudo reinstalling idb worked for me, thanks!

nathan-charles commented 4 years ago

I had to set my IDB binary location to -> /Library/Frameworks/Python.framework/Versions/3.7/bin/idb

azuxx commented 4 years ago

Fixed! In my case I did set to /usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/bin/idb and with latest version 0.50 also Doctor check succeeded.

nonewcode commented 4 years ago

For anyone installing this with homebrew, here are the steps i took

brew install python@3.8
brew tap facebook/fb
brew install idb-companion

From here i added a couple of lines to my .aliases file to ensure the latest python and pip versions are being used:

alias pip=$(brew --prefix)/bin/pip3.8
alias python=$(brew --prefix)/bin/python3.8

But you will also need to use sudo to install fb-idb but sudo also removes the pip alias.

alias sudo='sudo -H '

You can then install fb-idb with the following:

sudo pip install fb-idb

Everything should then work as expected.

IronTony commented 4 years ago

I uninstalled, installed something like 10 times but idb is not found in my entire system. I have the companion, but the client is missed. I have the message "successfully installed" but it is not. I tried sudo, not sudo...always the same result.

uzuki-P commented 4 years ago

In my case. I just need to add /Users/<username>/Library/Python/3.8/bin to PATH I use brew to install python3 and pip3.8 and pip3.8 install fb-idb --user -v

xcorpio commented 4 years ago

I just reinstall

➜  Homebrew git:(stable) pip3 uninstall fb-idb
Found existing installation: fb-idb 1.0.12
Uninstalling fb-idb-1.0.12:
  Would remove:
    /usr/local/lib/python3.8/site-packages/fb_idb-1.0.12.dist-info/*
    /usr/local/lib/python3.8/site-packages/idb/*
Proceed (y/n)? y
  Successfully uninstalled fb-idb-1.0.12
➜  Homebrew git:(stable) sudo -H pip3 install fb-idb
Collecting fb-idb
  Downloading fb_idb-1.0.12-py3-none-any.whl (125 kB)
     |████████████████████████████████| 125 kB 97 kB/s
Requirement already satisfied: treelib in /usr/local/lib/python3.8/site-packages (from fb-idb) (1.6.1)
Requirement already satisfied: protobuf in /usr/local/Cellar/protobuf/3.13.0/libexec/lib/python3.8/site-packages (from fb-idb) (3.13.0)
Requirement already satisfied: aiofiles in /usr/local/lib/python3.8/site-packages (from fb-idb) (0.5.0)
Requirement already satisfied: grpclib>=0.3.2 in /usr/local/lib/python3.8/site-packages (from fb-idb) (0.4.1)
Requirement already satisfied: future in /usr/local/lib/python3.8/site-packages (from treelib->fb-idb) (0.18.2)
Requirement already satisfied: six>=1.9 in /usr/local/Cellar/protobuf/3.13.0/libexec/lib/python3.8/site-packages (from protobuf->fb-idb) (1.15.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.8/site-packages (from protobuf->fb-idb) (49.6.0)
Requirement already satisfied: multidict in /usr/local/lib/python3.8/site-packages (from grpclib>=0.3.2->fb-idb) (5.0.0)
Requirement already satisfied: h2<5,>=3.1.0 in /usr/local/lib/python3.8/site-packages (from grpclib>=0.3.2->fb-idb) (4.0.0)
Requirement already satisfied: hyperframe<7,>=6.0 in /usr/local/lib/python3.8/site-packages (from h2<5,>=3.1.0->grpclib>=0.3.2->fb-idb) (6.0.0)
Requirement already satisfied: hpack<5,>=4.0 in /usr/local/lib/python3.8/site-packages (from h2<5,>=3.1.0->grpclib>=0.3.2->fb-idb) (4.0.0)
Installing collected packages: fb-idb
Successfully installed fb-idb-1.0.12
➜  Homebrew git:(stable) idb
usage: idb [-h] [--log {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--companion COMPANION] [--companion-path COMPANION_PATH]
           [--companion-local] [--no-prune-dead-companion]
           {add-media,approve,boot,clear-keychain,clone,companion,connect,contacts,crash,create,daemon,debugserver,delete,delete-all,describe,disconnect,dsym,dylib,erase,file,focus,framework,install,instruments,kill,launch,list-apps,list-targets,log,open,pull,push,record,screenshot,set-location,shutdown,terminate,ui,uninstall,video,record-video,xctest}
           ...

idb: a versatile tool to communicate with iOS Simulators and Devices

positional arguments:
  {add-media,approve,boot,clear-keychain,clone,companion,connect,contacts,crash,create,daemon,debugserver,delete,delete-all,describe,disconnect,dsym,dylib,erase,file,focus,framework,install,instruments,kill,launch,list-apps,list-targets,log,open,pull,push,record,screenshot,set-location,shutdown,terminate,ui,uninstall,video,record-video,xctest}
    add-media           Add photos/videos to the target
    approve             Approve permissions for an app
    boot                Boots a simulator (only works on mac)
    clear-keychain      Clear the targets keychain
    clone               Erases the simulator (only works on mac)
    companion           commands related to the companion
    connect             Connect to a companion
    contacts            Contacts database operations on target
    crash               Operations on crashes
    create              Creates an iOS Simulator
    daemon              This command is deprecated. the idb daemon is not used anymore.
    debugserver         debugserver interactions
    delete              Deletes (only works on mac)
    delete-all          Deletes all simulators (only works on mac)
    describe            Describes the Target
    disconnect          Disconnect a companion
    dsym                dsym commands
    dylib               dylib commands
    erase               Erases the simulator (only works on mac)
    file                File operations on target
    focus               Brings the simulator window to front
    framework           framework commands
    install             Install an application
    instruments         Run instruments on the device
    kill                Kill the idb daemon
    launch              Launch an application. Any environment variables of the form IDB_X
                         will be passed through with the IDB_ prefix removed.
    list-apps           List the installed apps
    list-targets        List the connected targets
    log                 Obtain logs from the target
    open                Open a URL
    pull                Copy a file inside an application's container
    push                Copy file(s) from local machine to target
    record              Record what the screen is doing
    screenshot          Take a Screenshot of the Target
    set-location        Set a simulator's location
    shutdown            Shuts the simulator down (only works on mac)
    terminate           Terminate a running application
    ui                  UI interactions on target
    uninstall           Uninstall an application
    video (record-video)
                        Record the target's screen to a mp4 video file
    xctest              Operations with xctest on target

optional arguments:
  -h, --help            show this help message and exit
  --log {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Set the logging level
  --companion COMPANION
                        A string of the form HOSTNAME:PORT that will describe the companion connect to.Can also be set with the IDB_COMPANION environment variable
  --companion-path COMPANION_PATH
                        The path to the idb companion binary. This is only valid when running on macOS platforms
  --companion-local     If set, any companion provided via IDB_COMPANION or --companion will be assumed to be running on this host.Even if the companion provided is 'localhost' idb will still assume it is remote.The reason for this is that idb shouldn't assume there are no tunnels from localhost to a remote host.Can also be set with the IDB_COMPANION_LOCAL environment variable
  --no-prune-dead-companion
                        If flagged will not modify local state when a companion is known to be unresponsive

See Also: https://www.fbidb.io/docs/guided-tour
usage: idb [-h] [--log {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--companion COMPANION] [--companion-path COMPANION_PATH]
           [--companion-local] [--no-prune-dead-companion]
           {add-media,approve,boot,clear-keychain,clone,companion,connect,contacts,crash,create,daemon,debugserver,delete,delete-all,describe,disconnect,dsym,dylib,erase,file,focus,framework,install,instruments,kill,launch,list-apps,list-targets,log,open,pull,push,record,screenshot,set-location,shutdown,terminate,ui,uninstall,video,record-video,xctest}
           ...
idb: error: No subcommand found for root_command
➜  Homebrew git:(stable) which idb
/usr/local/bin/idb
tafty commented 4 years ago

I'm using pyenv and my idb installation ended up here:

/Users/<username>/.pyenv/versions/3.7.3/bin/idb

BookOfStopHere commented 4 years ago

@daniocean Try running as root (sudo pip3.7 install fb-idb). It should install on /usr/local/bin/idb. THX. Solved my problem

alexpovkolas commented 3 years ago

You can run which idb and set the path to Flipper -> Settings

thiago-sants commented 3 years ago

It's really simple! You just have to reinstall it an unknown number of times, try every solution posted here, hope supernatural forces are at your side, and BOOM, it works! It's so good to feel in a casino when you're installing a tool!

IgorGanapolsky commented 3 years ago

Mine got installed in /Users/igorganapolsky/.pyenv/shims/idb

joshbuchea commented 3 years ago

The install location can vary for different system configurations, but for me idb was installed to /Users/joshbuchea/Library/Python/3.9/bin/idb after installing with pip3 install --user fb-idb.

Running macOS Big Sur 11.2.3. I may have used brew to install python3 and pip3, but can't recall ATM 😅

Everything worked after making these changes:

Note: The pip3 install fb-idb command failed when I ran it due to a permissions issue. I try to configure the dev environment on my system at the user-level and avoid using sudo aside from rare cases when there are no alternatives. On my system, it was necessary to include the --user option to successfully install idb.

ice6 commented 3 years ago

For anyone in china struggling with this problem.

If you are using aliyun mirror url as me.

Just delete the aliyun mirror url in your pip.conf file, then pip can install the correct package for you.

With the right source, if you install with sudo, the following files will be installed:

/usr/local/bin/idb
/usr/local/lib/python3.9/site-packages/fb_idb-1.1.5.dist-info/*
/usr/local/lib/python3.9/site-packages/idb/*
/usr/local/proto/idb.proto
/usr/local/protoc_compiler_template.py

if you install with --user, the idb will be installed at /Users/{yourname}/Library/Python/{yourversion}/bin/

png995 commented 2 years ago

Getting message like fileCommandsForApplicationContainers not supported on devices, requires a rooted device The application is developer signed any additional things like UIFileSharing Enabled to be set on plist ? Not able to execute file operations! (https://fbidb.io/docs/file-containers)

ron881212 commented 2 years ago

I had to disable my VPN after getting HTTPSConnectionPool and SSLError errors.

MANTENN commented 2 years ago

Install it this way:

pip3 install fb-idb --prefer-binary

Was hell to get it working.

MANTENN commented 2 years ago

Should install it to:

/usr/local/bin/idb

If you don't find it, use which idb and paste that into flipper.

buptfarmer commented 2 years ago
pip3.9 install fb-idb --prefer-binary --user

really works for me . thanks @MANTENN

Install it this way:

pip3 install fb-idb --prefer-binary

Was hell to get it working.

AlexandreLage commented 2 years ago

https://stackoverflow.com/questions/72696726/flipper-desktop-failed-to-provide-certificates-error-from-flipper-desktop/74160205#74160205

I noticed my local idb_companion server was crashing when Flipper tried to connect to tit, and I was able to see why. I wrote what I learned on this answer.

grgp commented 1 year ago

I was using pyenv so running pip3 install fb-idb --prefer-binary installed it in /Users/<username>/.pyenv/shims/idb, it turns out copying that /.pyenv/ path to the settings doesn't work.

You do have to use sudo or --user so it's installed in the correct path.

jacklj commented 1 year ago

With pyenv, uninstalling all versions of idb (I had two in different python versions), and then reinstalling, did it for me - Flipper could then successfully use the /.pyenv/ path

owen800q commented 1 year ago

@jacklj This working for me, first time install idb with pyenv, not working I uninstalled it and tried again, it works

dbejo commented 12 months ago

Installing with sudo solved the issue for me

servitola commented 8 months ago

I had the same issue. What I've done:

now Xamarin.UITest for iOS works on XCode 14.3 and Ventura 13.6

I'm not sure it's the best way but it works

harit2305 commented 7 months ago

brew install python@3.8 brew tap facebook/fb

Thank you so much brother

Donaid commented 4 months ago

im supud

echo "export PATH=\$PATH:/Users/macbook/Library/Python/<YOUR-VERSION>/bin" >> ~/.bash_profile
source ~/.bash_profile
idb