如何防止ADB客户端自动启动ADB服务器?

发布于 2025-01-17 07:36:53 字数 63 浏览 1 评论 0 原文

似乎每当 adb 客户端无法与 adb 服务器通信时,它就会自动启动它。有没有办法阻止adb服务器这样自动启动?

It seems like whenever adb client cannot communicate with adb server, it automatically starts it. Is there a way to prevent adb server from automatically starting like this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拍不死你 2025-01-24 07:36:53

您可以指定服务器地址,如果 adb 认为它不是本地地址,那么 adb 将不会启动本地服务器。

以“local”开头的地址被视为本地地址,但“127.0.0.1”则不是。

因此,您可以设置 ADB_SERVER_SOCKET=127.0.0.1:5037ANDROID_ADB_SERVER_ADDRESS=127.0.0.1 来阻止启动本地服务器。

如果您对详细信息感兴趣,请参阅 is_local_socket_spec =“不关注” noreferrer">https://android.googlesource.com/platform/system/adb/+/d7285b7cdd139ada5d662b5f3c1c5a4e16462299/socket_spec.cpp#128

You can specify server address and if adb think it is not a local address, then adb won't start a local server.

Addresses start with "local" are considered as local address, but "127.0.0.1" is not.

So you can set ADB_SERVER_SOCKET=127.0.0.1:5037 or ANDROID_ADB_SERVER_ADDRESS=127.0.0.1 to prevent starting local server.

If you are interested in the detail, see is_local_socket_spec in https://android.googlesource.com/platform/system/adb/+/d7285b7cdd139ada5d662b5f3c1c5a4e16462299/socket_spec.cpp#128

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文