buck

Change buck adb port


Is there a way to change the default port that buck uses for adb?

I have an adb tunneling on a server to use my local machine connected devices, so I'm using a different port that the default one (5037).

But when I do a buck install it spawns a new adb server using the default port, which of course won't find any device...

I tried to look a the documentation and code and I couldn't find any reference.


Solution

  • Since buck only calls the adb command, setting the ANDROID_ADB_SERVER_PORT env variable should change the port that adb uses. Just make sure to kill any buck and adb process after setting the variable