Skip to content

Instantly share code, notes, and snippets.

@lisicnu
Forked from mohsenk/Gradle_Adb_Plugin.gradle
Created October 29, 2016 07:11
Show Gist options
  • Save lisicnu/bea670d0f932574c0a27297e4759b8dd to your computer and use it in GitHub Desktop.
Save lisicnu/bea670d0f932574c0a27297e4759b8dd to your computer and use it in GitHub Desktop.

Revisions

  1. Mohsen revised this gist Feb 4, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Gradle_Adb_Plugin.gradle
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,8 @@ task adbConnect(type: Exec) {
    button(defaultButton: true, text: 'Connect', actionPerformed: {
    def device_ip = input.text;
    println "Connecting to Device With IP : $device_ip";
    executable System.getenv("ANDROID_HOME") + "\\platform-tools\\adb.exe"
    def adb = "$System.env.ANDROID_HOME/platform-tools/adb.exe"
    executable adb
    args "connect", device_ip
    dispose(); // Close dialog
    })
  2. Mohsen revised this gist Feb 4, 2015. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion Gradle_Adb_Plugin.gradle
    Original file line number Diff line number Diff line change
    @@ -26,4 +26,14 @@ task adbConnect(type: Exec) {
    }
    }
    }
    }
    }


    task adbDevices(type: Exec) {
    executable System.getenv("ANDROID_HOME") + "\\platform-tools\\adb.exe"
    args "devices"
    }
    task adbLogCat(type: Exec) {
    executable System.getenv("ANDROID_HOME") + "\\platform-tools\\adb.exe"
    args "logcat"
    }
  3. Mohsen created this gist Feb 4, 2015.
    29 changes: 29 additions & 0 deletions Gradle_Adb_Plugin.gradle
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    import groovy.swing.SwingBuilder

    task adbConnect(type: Exec) {
    doFirst {
    new SwingBuilder().edt {
    dialog(modal: true,
    title: 'Enter password',
    alwaysOnTop: true,
    resizable: false,
    locationRelativeTo: null,
    pack: true,
    show: true
    )
    {
    vbox { // Put everything below each other
    label(text: "Please enter your Android device IP")
    input = textField()
    button(defaultButton: true, text: 'Connect', actionPerformed: {
    def device_ip = input.text;
    println "Connecting to Device With IP : $device_ip";
    executable System.getenv("ANDROID_HOME") + "\\platform-tools\\adb.exe"
    args "connect", device_ip
    dispose(); // Close dialog
    })
    }
    }
    }
    }
    }