8

Marcs-MacBook-Pro:java marcus$ pidcat com.myapp.android.debug

Traceback (most recent call last):
  File "/usr/local/bin/pidcat", line 150, in <module>
    adb = subprocess.Popen(adb_command, stdin=PIPE, stdout=PIPE, stderr=PIPE)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 709, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1326, in _execute_child
    raise child_exception
OSError: [Errno 20] Not a directory

I specified com.myapp.android.debug since I saw it in Android Studio's logcat viewer, though I don't physically have the debug folder. I ran the pidcat script in the parent directory of "com"; java/com/myapp/android

MarcusH
  • 1,693
  • 2
  • 15
  • 20

3 Answers3

4

Make sure that adb is in your path, and that you use an absolute path, no tilda (~)

So you should be able to run echo $PATH and get something like this.

Marcs-MacBook-Pro:java marcus$ echo $PATH
/Users/marcush/Library/Android/sdk/platform-tools:<restofpath>
TomW
  • 310
  • 1
  • 7
2

Related to the above error , you might not have the pidcat.py script on your system. Please ensure the following (as steps mentioned on pidcat page)

  1. Python is installed on your system
  2. Command Line 'adb' is installed. If not try adding sdk path in your PATH variable
export PATH=“/Users/userName/Library/Android/sdk/platform-tools”:$PATH 

Refer Set up adb on Mac OS X)

  1. Include these lines in your .bashrc or .zshrc
echo "export PATH=\$PATH:/Users/${USER}/Library/Android/sdk/platform-tools/" >> ~/.bash_profile && source ~/.bash_profile

  1. Verify adb is up and running, by using
adb devices
  1. Download the pidcat.py file and place it in your path.

  2. final path will look something like this

export PATH=/Users/mayurik/Library/Android/sdk/platform-tools/adb:/Users/mayurik/Library/Android/sdk/tools:/Users/mayurik/pidcat/pidcat.py:/anaconda2/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

  1. Finally try running pidcat on your terminal.
Mayuri Khinvasara
  • 1,437
  • 1
  • 16
  • 12
0

I had the same error log displayed. It is working after setting the adb path to $PATH env variable in my mac. Do try it once. Check adb is working fine before running pidcat command.i.e, try running adb devices should return you the connected devices.

export PATH=$PATH:<path to Android SDK>/platform-tools
export PATH=$PATH:<path to Android SDK>/tools
Isanaka
  • 133
  • 1
  • 7
  • Where do I have to write this export command? – Afaq Khan May 30 '21 at 20:37
  • We can run these from terminal on mac or command prompt in windows for the opened session. We can add these commands to .bashrc or .zshrc to have the persistence. Do refer the answer from @Mayuri Khinvasara above. She has detailed the steps. – Isanaka Jun 17 '21 at 10:20