This repo contains a few scripts to make your life easier if you work with Android Terminals from command line.
Automate your adb resatart when adb won't see your device again:
$ adb kill-server
$ adb start-server
This command will search for available emulators and let you choose which one launch. After that it starts emulator and connects to it with telnet.
This command relies on expect
available in your $PATH
and available ~/.emulator_console_auth_token
.
$ emanager
Choose device:
[0] Pixel_3_XL_API_30
[1] Pixel_6_API_24
[2] Pixel_6_API_30
$ 0
Pixel_3_XL_API_30 emulator is being started...
~~
Devices before emulator start:
Devices after emulator start:
emulator-5554
New devices:
emulator-5554
Found new device, connecting to emulator-5554
spawn telnet localhost 5554
Android Console: Authentication required
auth <your_token_will_be_here>
OK
You can exit from dialog with quit
or exit
.
$ emanager
Choose device:
[0] Pixel_3_XL_API_30
[1] Pixel_6_API_24
[2] Pixel_6_API_30
$ quit
Goodbye!
emanager
could also be started with arguments:
Flag | Description |
---|---|
-w |
Wipes emulator by starting it with -wipe-data |
-v |
All of the emulator output will be shown, not only stderr |
-a args |
args will be added to the emulator command |
With -a
flag you can do basically anything with emulator but you do not need find available avds or manually connect to the console.
Enjoy!