-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevices.bat
More file actions
30 lines (23 loc) · 804 Bytes
/
devices.bat
File metadata and controls
30 lines (23 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@echo off
echo Disconnecting old connections...
adb disconnect
echo Setting up connected device
adb tcpip 5555
echo Waiting for device to initialize
timeout 3
FOR /F "tokens=2" %%G IN ('adb shell ip addr show wlan0 ^|find "inet "') DO set ipfull=%%G
FOR /F "tokens=1 delims=/" %%G in ("%ipfull%") DO set ip=%%G
echo Connecting to device with IP %ip%...
adb connect %ip%
@echo off
rem Set the IP address of your Android device
set DEVICE_IP=192.168.1.12
rem Set the port number for ADB
set ADB_PORT=5555
rem Set the path to the ADB executable
set ADB_PATH="C:\Users\MOUNIR\Downloads\platform-tools-latest-windows\platform-tools\adb.exe"
rem Restart the ADB server
%ADB_PATH% kill-server
%ADB_PATH% start-server
rem Connect to the Android device over Wi-Fi
%ADB_PATH% connect %DEVICE_IP%:%ADB_PORT%