3

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 ?

hsz
  • 148,279
  • 62
  • 259
  • 315

3 Answers3

1

--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

Gil
  • 568
  • 5
  • 9
1

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.

Adrian Günter
  • 903
  • 2
  • 11
  • 23
  • 1
    Nice and elegant solution, without having to worry about it too much (although connection fails sometimes, ADB's fault.) – Elad Nava Jun 20 '15 at 21:30
0

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.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904