facebook / idb

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

idb list-targets returns No available targets #560

Open xuzhaocheng opened 5 years ago

xuzhaocheng commented 5 years ago

Description

idb list-targets returns "NO avalibale target"

python version: 3.7

brew info idb-companion facebook/fb/idb-companion: stable 1.0.9 (bottled), HEAD A Powerful Command Line for automating iOS Simulators https://github.com/facebook/idb/README.md /usr/local/Cellar/idb-companion/1.0.9 (248 files, 24.3MB) * Poured from bottle on 2019-10-08 at 11:26:26 From: https://github.com/facebook/homebrew-fb/blob/master/idb-companion.rb ==> Dependencies Required: grpc --1.23.0_1 ✔ ==> Requirements Build: xcode ✔

brew info grpc grpc: stable 1.23.0 (bottled), HEAD Next generation open source RPC library and framework https://grpc.io/ /usr/local/Cellar/grpc/1.23.0_3 (310 files, 21.9MB) * Poured from bottle on 2019-10-08 at 11:13:50 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/grpc.rb ==> Dependencies Build: autoconf ✔, automake ✘, libtool ✔ Required: c-ares ✔, gflags ✔, openssl@1.1 ✔, protobuf ✔

idb_companion --notify /tmp/idb_local_targets dyld: Library not loaded: /usr/local/opt/protobuf/lib/libprotobuf.20.dylib Referenced from: /usr/local/bin/idb_companion Reason: image not found Abort trap: 6

I could find libprotobuf.21.dylib in fold /usr/local/opt/protobuf/lib/ but there is no libprotobuf.20.dylib. Did I install the incorrect version of the grpc?

Reproduction

execute idb list-targets

Solution

Additional Information

ChristianYeah commented 5 years ago

you are right. compile the source code of version 1.0.8. then link /usr/local/bin/idb_companion to the 1.0.8 binary, it will at lease boot the simulator. I'm new to the idb, so im still working on it.

eparadis commented 5 years ago

I installed version 1.0.8 with brew using

brew install https://raw.githubusercontent.com/facebook/homebrew-fb/6bbdd01575975bfa6aff055fd0fcdb619e539609/idb-companion.rb

It installed the correct version:

ed@Eds-MacBook-Pro:~$ ls -l `which idb_companion`
lrwxr-xr-x  1 ed  admin  47 Oct  9 13:58 /usr/local/bin/idb_companion -> ../Cellar/idb-companion/1.0.8/bin/idb_companion

Yet, I still see:

ed@Eds-MacBook-Pro:~$ idb_companion 
dyld: Library not loaded: /usr/local/opt/protobuf/lib/libprotobuf.18.dylib
  Referenced from: /usr/local/bin/idb_companion
  Reason: image not found
Abort trap: 6

This is on Mojave 10.14.6 with XCode 11.1 (11A1027)

eparadis commented 5 years ago

I was able to make a little progress by using

brew install idb-companion --HEAD

This gave me version

HEAD-4938346

idb list-targets returned nothing, but by running idb_companion --notify /tmp/idb_local_targets in another terminal, I was able to get the expected response from idb list-targets 🎉

I caution others to be careful using --HEAD... it will break if you use this in your CI. We've constantly hit this with fbsimctl HEAD being broken. 😞 I suggest if you get something working, copy the binaries or freeze your VM!

Solganis commented 5 years ago

@eparadis thanks for this tip -

idb_companion --notify /tmp/idb_local_targets in another terminal, I was able to get the expected response from idb list-targets 🎉

Helped me to get it working.

ChristianYeah commented 5 years ago

@eparadis thanks for this tip -

idb_companion --notify /tmp/idb_local_targets in another terminal, I was able to get the expected response from idb list-targets 🎉

Helped me to get it working.

follow the comment written by @eparadis , his solution is correct, v1.0.8 doesn't support notify targets to file

berezinni commented 5 years ago

It helped me Create symlink

$ ln -s /usr/local/Cellar/idb-companion/HEAD-0a14034/bin/idb_companion idb_companion
xuzhaocheng commented 5 years ago

I was able to make a little progress by using

brew install idb-companion --HEAD

This gave me version

HEAD-4938346

idb list-targets returned nothing, but by running idb_companion --notify /tmp/idb_local_targets in another terminal, I was able to get the expected response from idb list-targets 🎉

I caution others to be careful using --HEAD... it will break if you use this in your CI. We've constantly hit this with fbsimctl HEAD being broken. 😞 I suggest if you get something working, copy the binaries or freeze your VM!

@eparadis thanks. It helped me.

zhroot commented 5 years ago

just need install libprotobuf.20.dylib on local machine, or compile the source again.

brew install idb-companion -s is a better choose

Sivasankaramalan commented 4 years ago

I was able to make a little progress by using

brew install idb-companion --HEAD

This gave me version

HEAD-4938346

idb list-targets returned nothing, but by running idb_companion --notify /tmp/idb_local_targets in another terminal, I was able to get the expected response from idb list-targets 🎉 I caution others to be careful using --HEAD... it will break if you use this in your CI. We've constantly hit this with fbsimctl HEAD being broken. 😞 I suggest if you get something working, copy the binaries or freeze your VM!

@eparadis thanks. It helped me.

I was able to make a little progress by using

brew install idb-companion --HEAD

This gave me version

HEAD-4938346

idb list-targets returned nothing, but by running idb_companion --notify /tmp/idb_local_targets in another terminal, I was able to get the expected response from idb list-targets 🎉

I caution others to be careful using --HEAD... it will break if you use this in your CI. We've constantly hit this with fbsimctl HEAD being broken. 😞 I suggest if you get something working, copy the binaries or freeze your VM!

@eparadis Thanks for this solution

c-ryan747 commented 4 years ago

I've just released a new version of idb (v1.0.10) that has all of the current fixes included.

I think spawning the companion notifier automatically is still be broken, but I might be able to take a look at this before the end of the year.

Sivasankaramalan commented 4 years ago

I've just released a new version of idb (v1.0.10) that has all of the current fixes included.

I think spawning the companion notifier automatically is still be broken, but I might be able to take a look at this before the end of the year.

Could you please add the steps to Update? Is that normal brew update

c-ryan747 commented 4 years ago

A normal update through brew should work. You'll probably also want to update the idb client (fb-idb)

One thing to note is that the idb client now requires python 3.7

brew upgrade idb
pip3.7 install --upgrade fb-idb
rajshah commented 3 years ago

Weird! same session terminal $idb list-targets No available targets $which idb_companion /usr/local/bin/idb_companion $ls -l which idb_companion /usr/local/bin/idb_companion -> ../Cellar/idb-companion/1.0.14/bin/idb_companion $idb list-targets < Targets listed >