2024-10-11 23:27:07 +03:00
|
|
|
{ ... }:
|
|
|
|
{
|
|
|
|
text = ''
|
|
|
|
# Start an Android emulator.
|
|
|
|
# Default name is `main`.
|
|
|
|
# Usage: emulator [NAME]
|
|
|
|
function emulator() {
|
|
|
|
local name="$1"
|
2024-04-06 03:03:58 +03:00
|
|
|
|
2024-10-11 23:27:07 +03:00
|
|
|
[[ "$name" = "" ]] && name="main"
|
2024-04-06 03:03:58 +03:00
|
|
|
|
2024-10-11 23:27:07 +03:00
|
|
|
steam-run ~/.android/sdk/emulator/emulator -avd "$name" &> /dev/null & disown
|
|
|
|
}
|
2024-04-06 03:03:58 +03:00
|
|
|
|
2024-10-11 23:27:07 +03:00
|
|
|
function _android_emulators() {
|
|
|
|
_autocomplete_first $(ls --classify ~/.android/avd/ | grep \/$ | sed -e "s/.avd\/$//")
|
|
|
|
}
|
2024-04-06 03:03:58 +03:00
|
|
|
|
2024-10-11 23:27:07 +03:00
|
|
|
complete -F _android_emulators emulator
|
|
|
|
'';
|
2024-04-06 03:03:58 +03:00
|
|
|
}
|