通过adb自动无线连接Android设备和IntelliJ
我正在使用 IntelliJ 来开发 Android 应用程序。 在我的设备上,我安装了 adbWireless
,它允许我通过 WiFi 调试应用程序。
要将我的 PC 与设备连接,我必须调用终端
adb connect 192.168.1.105:5555
,现在我可以在 IntelliJ 中运行调试。
是否可以将 IntelliJ 配置为在设备断开连接时自动执行此操作?
I am using IntelliJ
to develop Android application.
On my device I've installed adbWireless
which allow me to debug application via WiFi.
To connect my PC with device I have to call in terminal
adb connect 192.168.1.105:5555
and since now I can run debug in IntelliJ.
Is it possible to configure IntelliJ to do it automatically if device is disconnected ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
--对于WINDOWS用户--
基本上您创建一个名为:adb_connect.bat的文件,
在文件中添加以下内容:
C:\Android\android-sdk\platform-tools\adb.exe connect 192.168.11.179:5555< /strong>
暂停
编辑 adb.exe 的路径,
如果你想查看结果
,你的设备 IP 保留“暂停”,然后就可以了。
只需在每次连接设备时运行该文件即可。
它对我有用:-)
顺便说一句,如果你给你的设备一个静态IP,你就不必在每次连接时重新编辑文件
享受
--for WINDOWS users--
basically you create a file called: adb_connect.bat
in the file add this content:
C:\Android\android-sdk\platform-tools\adb.exe connect 192.168.11.179:5555
pause
edit the path to your adb.exe, and your device ip
leave the "pause" if you want to see the results
and there you have it.
just run the file each time you connect your device.
it works for me :-)
BTW, if you give your device a static ip you wont have to re edit the file each time you connect
enjoy
您可以编辑运行配置,以便在上传和启动 APK 之前自动连接到您的设备。
展开特定运行配置底部的启动前部分,并添加一个新的外部工具,该工具调用 ADB 并传递连接和 IP 参数。
You can edit your run configuration to automatically connect to your device before uploading and launching the APK.
Expand the Before launch section at the bottom of a specific run config, and add a new External Tool which calls ADB and passes the connect and IP parameters.
恐怕这是不可能的,但是您可以配置外部工具并将其绑定到热键,您也可以创建一个宏,它首先运行外部工具,然后开始调试。
I'm afraid it's not possible, however you can configure an External Tool and bind it to hotkey, you can probably also create a macro which will first run your external tool and then start debugging.