Skip to content

Instantly share code, notes, and snippets.

View rizperdana's full-sized avatar
🖥️
Coding

Perdana rizperdana

🖥️
Coding
  • Indonesia
  • 01:24 (UTC +07:00)
View GitHub Profile
@rizperdana
rizperdana / scrpwireless.md
Created August 14, 2024 01:24
Script to allow your android phone connect wirelessly with your laptop via wifi or phone tethering
#!/bin/bash
# Step 1: Get phone's IP address
echo "Finding phone's IP address..."
PHONE_IP=$(adb shell ip route | awk '{print $9}')
# Check if IP address was found
if [ -z "$PHONE_IP" ]; then
echo "Could not find the phone's IP address. Make sure your phone is connected via USB and USB debugging is enabled."
exit 1