Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Vivek9190/3c186cb05d8e1f1707453cb42d6d3a49 to your computer and use it in GitHub Desktop.
Save Vivek9190/3c186cb05d8e1f1707453cb42d6d3a49 to your computer and use it in GitHub Desktop.
Get Wish URL in Genshin Impact 3.x on Android using Android Debugging Tools

Using Termux on Android 10 or above

  1. Open and Download Termux (Do not download from Play Store as it is not up-to-date)
  2. Enable Wireless Debugging on your Android phone
  3. Open Termux and run pkg update && pkg install android-tools termux-api (if failed, run apt update && apt install android-tools termux-api instead)
  4. Open Settings > System > Developer Options > Wireless Debugging. Open the app switcher then tap and hold the Settings app icon. Select "Split top", then select Termux as the bottom half.
  5. Tap on "Pair device with pairing code" and a window will appear. Go to Termux and run adb pair localhost:12345 replacing 12345 with the port number shown in the window (192.168.x.x:12345). Enter the pairing code when prompted, the pairing window will close automatically.
  6. Run adb connect localhost:23456 replacing 23456 with the port number shown under "IP address & Port" (192.168.x.x:23456)
  7. Run adb logcat -m 1 -e "OnGetWebViewPageFinish.+https.+/log" | grep -oE "https.+/log" | tee >(termux-clipboard-set)
  8. Open Genshin Wish history
  9. The wish URL should be written to your clipboard already. If not, you can copy the text output in Termux
  10. Paste to paimon.moe.

After running once, start from step 6 when you want to fetch wish URL again

Alternative steps (see video):

  1. Run adb shell
  2. Run am start -a android.intent.action.VIEW -d "$(logcat -m 1 -e "OnGetWebViewPageFinish.+https.+/log" | grep -oE "https.+/log")"
  3. Open Genshin Wish history. Once opened, the page would load in a browser instead
  4. Tap on the address bar, select all, and copy
  5. Paste to paimon.moe.

Using PC

  1. Connect your Android phone to your computer with a USB cable
  2. Enable USB Debugging on your Android phone
  3. Windows: Press Win+R and paste:
    powershell iex(irm 'https://gist.githubusercontent.com/jogerj/2372d0e5bee51e001a6d8956240d527b/raw/831184c2b14bb06511a854a7c9b50ae9d57a673f/getlink_android.ps1')
    Linux/macOS: Open Terminal and paste:
    bash -c "$(curl -fsSL https://gist.githubusercontent.com/jogerj/2372d0e5bee51e001a6d8956240d527b/raw/26aabb5967e657bb491a67d761f76e655f872316/getlink_android.sh)"
  4. Paste to paimon.moe under PC > Method 1

What is "adb"?

The Android Debug Bridge is a developer tool for Android that allows your computer to interact with your Android phone. It also allows you to invoke commands on your phone from your computer and monitor its output directly. This script will download ADB to your computer and runs it to interact with your phone. After the script finishes, it will clean up after itself. The download is about 5 MB.

Troubleshooting

Could not connect to android device!

  1. Try disabling/enabling USB debugging
  2. Open notification drawer, tap on "Charging this device via USB", change to "File Transfer" or "MTP"
  3. You can also connect with adb via wifi (instructions soon)

I don't want to download adb each time

You can download ADB from here and extract the zip file. You can connect to your phone with ADB via Wi-Fi. (Android 11+ guide, Android 10 and lower guide) or with a USB cable.

  • Windows:

    Open Powershell in the platform-tools directory and paste following:

    .\adb logcat -m 1 -e "OnGetWebViewPageFinish" | % {if ($_ -match "https.+/log") { $wishUrl = $Matches[0]; Write-Host $wishUrl; Set-Clipboard -Value $wishUrl}}
  • macOS:

    Open Terminal in the platform-tools directory and paste following:

    url="$(grep -m 1 -oE "https.+/log" <( adb logcat -m 1 -e "OnGetWebViewPageFinish" ) )"; echo "$url"; echo -e "$url" | pbcopy;
  • Linux:

    Open Terminal in the platform-tools directory and paste following:

    url="$(grep -m 1 -oE "https.+/log" <( adb logcat -m 1 -e "OnGetWebViewPageFinish" ) )"; echo "$url"; echo -e "$url" | xclip -selection c;
  • Android:

    In Termux first run apt install android-tools termux-api and connect over Wi-Fi. Paste following:

    url="$(grep -m 1 -oE "https.+/log" <( adb logcat -m 1 -e "OnGetWebViewPageFinish" ) )"; echo "$url"; echo -e "$url" | termux-clipboard-set;

Alternative video tutorial on running from Android (without PC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment