Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a function to get the app setup class by name. #152

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android_world/env/setup_device/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ class RecipeApp(AppSetup):
"""Class for setting up Broccoli Recipe app."""

apk_names = ("com.flauschcode.broccoli_1020600.apk",)
app_name = "broccoli"
app_name = "broccoli app"

@classmethod
def setup(cls, env: interface.AsyncEnv) -> None:
Expand Down Expand Up @@ -593,7 +593,7 @@ class OpenTracksApp(AppSetup):
"""Class for setting up OpenTracks app."""

apk_names = ("de.dennisguse.opentracks_5705.apk",)
app_name = "activity tracker"
app_name = "open tracks sports tracker"

@classmethod
def setup(cls, env: interface.AsyncEnv) -> None:
Expand Down
5 changes: 5 additions & 0 deletions android_world/env/setup_device/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
)


def get_app_mapping(app_name: str) -> Type[apps.AppSetup]:
mapping = {app.app_name: app for app in _APPS}
return mapping[app_name]


def download_and_install_apk(
apk: str, raw_env: env_interface.AndroidEnvInterface
) -> None:
Expand Down