newbit1 / rootAVD

Script to root AVDs running with QEMU Emulator from Android Studio
GNU General Public License v3.0
1.45k stars 186 forks source link

file "ramdisk.img" not found. #93

Closed Ko-kn3t closed 1 year ago

Ko-kn3t commented 1 year ago

I can successfully list all AVDs. But when I run the command, it show me file not found.

Command Examples:
rootAVD.bat
rootAVD.bat ListAllAVDs
rootAVD.bat InstallApps

rootAVD.bat C:\android-sdk\system-images\android-32\google_apis\x86_64\ramdisk.img
rootAVD.bat C:\android-sdk\system-images\android-32\google_apis\x86_64\ramdisk.img FAKEBOOTIMG
rootAVD.bat C:\android-sdk\system-images\android-32\google_apis\x86_64\ramdisk.img DEBUG PATCHFSTAB GetUSBHPmodZ
rootAVD.bat C:\android-sdk\system-images\android-32\google_apis\x86_64\ramdisk.img restore
rootAVD.bat C:\android-sdk\system-images\android-32\google_apis\x86_64\ramdisk.img InstallKernelModules
rootAVD.bat C:\android-sdk\system-images\android-32\google_apis\x86_64\ramdisk.img InstallPrebuiltKernelModules
rootAVD.bat C:\android-sdk\system-images\android-32\google_apis\x86_64\ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG

rootAVD.bat C:\android-sdk\system-images\android-30\google_apis_playstore\x86\ramdisk.img
rootAVD.bat C:\android-sdk\system-images\android-30\google_apis_playstore\x86\ramdisk.img FAKEBOOTIMG
rootAVD.bat C:\android-sdk\system-images\android-30\google_apis_playstore\x86\ramdisk.img DEBUG PATCHFSTAB GetUSBHPmodZ
rootAVD.bat C:\android-sdk\system-images\android-30\google_apis_playstore\x86\ramdisk.img restore
rootAVD.bat C:\android-sdk\system-images\android-30\google_apis_playstore\x86\ramdisk.img InstallKernelModules
rootAVD.bat C:\android-sdk\system-images\android-30\google_apis_playstore\x86\ramdisk.img InstallPrebuiltKernelModules
rootAVD.bat C:\android-sdk\system-images\android-30\google_apis_playstore\x86\ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG

C:\Users\kokn3\rootAVD>rootAVD.bat C:\android-sdk\system-images\android-30\google_apis_playstore\x86\ramdisk.img
file C:\android-sdk\system-images\android-30\google_apis_playstore\x86\ramdisk.img not found

C:\Users\kokn3\rootAVD>
newbit1 commented 1 year ago

Can you show me how you set ANDROID_HOME ? Also please post the full log when you run

rootAVD.bat
rootAVD.bat ListAllAVDs

If I set ANDROID_HOME like this: set ANDROID_HOME=C:\android-sdk

it shows me only the paths without the leading C:\android-sdk\

W:\rootAVD>rootAVD.bat
rootAVD A Script to root AVD by NewBit XDA

Usage:  rootAVD [DIR/ramdisk.img] [OPTIONS] | [EXTRA ARGUMENTS]
or:     rootAVD [ARGUMENTS]

Arguments:
        ListAllAVDs                     Lists Command Examples for ALL installed AVDs

        InstallApps                     Just install all APKs placed in the Apps folder

Main operation mode:
        DIR                             a path to an AVD system-image
                                        - must always be the 1st Argument after rootAVD

ADB Path | Ramdisk DIR| ANDROID_HOME:
        [M]ac/Darwin:                   export PATH=~/Library/Android/sdk/platform-tools:$PATH
                                        export PATH=$ANDROID_HOME/platform-tools:$PATH
                                        system-images/android-$API/google_apis_playstore/x86_64/

        [L]inux:                        export PATH=~/Android/Sdk/platform-tools:$PATH
                                        export PATH=$ANDROID_HOME/platform-tools:$PATH
                                        system-images/android-$API/google_apis_playstore/x86_64/

        [W]indows:                      set PATH=%ANDROID_HOME%\platform-tools;%PATH%
                                        system-images\android-$API\google_apis_playstore\x86_64\

        ANDROID_HOME:                   By default, the script uses %LOCALAPPDATA%, to set its Android Home
                                        directory, search for AVD system-images and ADB binarys. This behaviour
                                        can be overwritten by setting the ANDROID_HOME variable.
                                        e.g. set ANDROID_HOME=%USERPROFILE%\Downloads\sdk

        $API:                           25,29,30,31,32,33,34,UpsideDownCake,etc.

Options:
        restore                         restore all existing .backup files, but doesn't delete them
                                        - the AVD doesn't need to be running
                                        - no other Argument after will be processed

        InstallKernelModules            install custom build kernel and its modules into ramdisk.img
                                        - kernel (bzImage) and its modules (initramfs.img) are inside rootAVD
                                        - both files will be deleted after installation

        InstallPrebuiltKernelModules    download and install an AOSP prebuilt kernel and its modules into ramdisk.img
                                        - similar to InstallKernelModules, but the AVD needs to be online

Options are exclusive, only one at the time will be processed.

Extra Arguments:
        DEBUG                           Debugging Mode, prevents rootAVD to pull back any patched file

        PATCHFSTAB                      fstab.ranchu will get patched to automount Block Devices like /dev/block/sda1
                                        - other entries can be added in the script as well
                                        - a custom build Kernel might be necessary

        GetUSBHPmodZ                    The USB HOST Permissions Module Zip will be downloaded into /sdcard/Download

        FAKEBOOTIMG                     Creates a fake Boot.img file that can directly be patched from the Magisk APP
                                        - Magisk will be launched to patch the fake Boot.img within 60s
                                        - the fake Boot.img will be placed under /sdcard/Download/fakeboot.img

Extra Arguments can be combined, there is no particular order.

Notes: rootAVD will
- always create .backup files of ramdisk*.img and kernel-ranchu
- replace both when done patching
- show a Menu, to choose the Magisk Version (Stable || Canary || Alpha), if the AVD is online
- make the choosen Magisk Version to its local
- install all APKs placed in the Apps folder
- use %ANDROID_HOME% to search for AVD system images

Command Examples:
rootAVD.bat
rootAVD.bat ListAllAVDs
rootAVD.bat InstallApps

rootAVD.bat system-images\android-33\google_apis_playstore\x86_64\ramdisk.img
rootAVD.bat system-images\android-33\google_apis_playstore\x86_64\ramdisk.img FAKEBOOTIMG
rootAVD.bat system-images\android-33\google_apis_playstore\x86_64\ramdisk.img DEBUG PATCHFSTAB GetUSBHPmodZ
rootAVD.bat system-images\android-33\google_apis_playstore\x86_64\ramdisk.img restore
rootAVD.bat system-images\android-33\google_apis_playstore\x86_64\ramdisk.img InstallKernelModules
rootAVD.bat system-images\android-33\google_apis_playstore\x86_64\ramdisk.img InstallPrebuiltKernelModules
rootAVD.bat system-images\android-33\google_apis_playstore\x86_64\ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG

And with rootAVD.bat system-images\android-30\google_apis_playstore\x86\ramdisk.img it finds the ramdisk.

If you are planing to use Magisk 26.x, don't forget the FAKEBOOTIMG argument. rootAVD.bat system-images\android-30\google_apis_playstore\x86\ramdisk.img FAKEBOOTIMG