10 Commits
Author SHA1 Message Date
sugoidogo 671c9f500f remove old support information 2025-12-15 11:38:28 +00:00
SugoiDogoandGitHub 7d13a21b9e Update README.md 2022-10-15 18:43:43 -06:00
SugoiDogoandGitHub 8bc2f30980 Update README.md 2022-10-15 18:18:16 -06:00
SugoiDogoandGitHub 4d370eb48b Update README.md 2022-10-15 06:25:00 -06:00
SugoiDogoandGitHub fbfd8e008e Update README.md 2022-10-05 16:25:38 -06:00
SugoiDogoandGitHub b366fb07e3 Update README.md 2022-10-01 15:56:10 -06:00
SugoiDogoandGitHub 92df13b064 Update README.md 2022-03-31 13:39:48 -06:00
josephsmendoza f6f615be35 added local adb support 2019-06-29 09:27:04 -07:00
josephsmendoza cdebf93978 it actually works now 2019-06-29 01:56:46 -07:00
Joseph mendozaandGitHub 4cff3580a4 Update README.md 2019-06-23 10:41:03 -07:00
3 changed files with 55 additions and 33 deletions
+4
View File
@@ -1,2 +1,6 @@
# adb-wireless
automatic activation/connection to wireless adb for android devices
icon from Sergei Kokota at [icon-icons](https://icon-icons.com/icon/wifi-router-smartphone-conexion-wireless/69169)
built with [7z SFX Builder](https://sourceforge.net/projects/s-zipsfxbuilder/)
+49 -26
View File
@@ -1,6 +1,6 @@
param(
[Parameter(Position=0)][String[]]$deviceID,
[String[]]$adb
[String]$adb,
[String]$workdir
)
Set-PSDebug -Trace 2
$ErrorActionPreference = 'Inquire'
@@ -8,34 +8,57 @@ $shell = New-Object -ComObject Wscript.Shell
[regex]$deviceIDRegex='(?<!:)(\w\w\w\w+)(?=\s+device)'
[regex]$deviceIPRegex='(\d+.\d+.\d+.\d+)(?=\/)'
if( !$adb ){
$adb=Get-Command "adb" -ErrorAction SilentlyContinue
if( !$adb ){
$shell.Popup("ADB not found!")
exit 1
if($workdir)
{
Set-Location $workdir
}
if( !$adb )
{
$adb=Get-Command "adb" -ErrorAction SilentlyContinue
if( !$adb )
{
if( Test-Path adb.exe )
{
$adb="adb.exe"
}
else
{
$shell.Popup("ADB not found!")
exit 1
}
}
}
$deviceID=& $adb devices
$deviceID=$deviceIDRegex.Matches($deviceID)
if($deviceID.Count -eq 0){
$shell.Popup("Device not found!")
exit 1
}
foreach ($devid in $deviceID){
$env:ANDROID_SERIAL=$devid
$devmodel=&$adb shell getprop ro.product.model
if($shell.Popup("connect $devmodel $devid wirelessely?",0,'',4) -eq 6) {
$tcpip=&$adb shell getprop service.adb.tcp.port
if ($tcpip.Length -eq 0)
{&$adb tcpip:5555
$tcpip='5555'}
$ip=&$adb shell ip -4 addr show wlan0
$ip=$deviceIPRegex.Match($ip)
if($ip.Length -eq 0)
{$shell.Popup("Device IP not found!")
exit 1}
$result=&adb connect $ip':'$tcpip
$shell.Popup($result)
if($deviceID.Count -eq 0)
{
$shell.Popup("Device not found!")
exit 1
}
foreach ($devid in $deviceID)
{
$env:ANDROID_SERIAL=$devid
$devmodel=&$adb shell getprop ro.product.model
if($shell.Popup("connect $devmodel $devid wirelessely?",0,'',4) -eq 6)
{
$tcpip=&$adb shell getprop service.adb.tcp.port
if ($tcpip.Length -eq 0)
{
&$adb tcpip 5555
$tcpip='5555'
Start-Sleep 1
&$adb wait-for-device
}
$ip=&$adb shell ip -4 addr show wlan0
$ip=$deviceIPRegex.Match($ip)
if($ip.Length -eq 0)
{
$shell.Popup("Device IP not found!")
exit 1
}
$result=&$adb connect $ip':'$tcpip
$shell.Popup($result)
}
}
+2 -7
View File
@@ -1,10 +1,5 @@
;!@Install@!UTF-8!
GUIMode="2"
MiscFlags="4"
RunProgram="powershell -executionpolicy bypass -file %%T\adb-wireless.ps1"
RunProgram="powershell -executionpolicy bypass -file %%T\adb-wireless.ps1 -workdir %%S"
;Config file generated by 7z SFX Builder v2.1. (http://sourceforge.net/projects/s-zipsfxbuilder/)
;!@InstallEnd@!
7zSFXBuilder_7zArchive=C:\Users\Josef\Documents\adb-wireless\adb-wireless.7z
7zSFXBuilder_SFXIcon=C:\Users\Josef\Documents\adb-wireless\1-45_icon-icons.com_69169.ico
7zSFXBuilder_UseDefMod=7zsd_All_x64
7zSFXBuilder_UPXCommands=--best --all-methods
;!@InstallEnd@!