我有一个已安装的 apk,但我无法在 mac 上使用带有文件资源管理器的 USB 找到它的路径 [英] I have an installed apk but i cannot find its path using usb with file explorer on mac

查看:19
本文介绍了我有一个已安装的 apk,但我无法在 mac 上使用带有文件资源管理器的 USB 找到它的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的 Android 设备上已安装的应用上运行 Appium.

I want to run Appium on an already installed app on my Android device.

(这是第 3 方应用程序.如 FB 或 Gmail)

(it's a 3rd party app. Like FB or Gmail)

我要设置

File appDir = new File(classpathRoot, "../../../---");
File app = new File(appDir, "----.apk");

但是我找不到安装在我的设备上的 apk 的位置(使用 USB 插入但在文件资源管理器中仍然没有找到该 apk)

But I cannot find where is the apk installed on my device (plugged in with USB and still don't find the apk in the file explorer)

如何轻松找到此 apk 路径?

how can i easily find this apk path?

推荐答案

如果您需要自动化已安装在 Android 设备上的应用程序,则根本不需要指定 APK 文件.您的能力应该如下:

If you need to automate an app which is already installed on your Android device, you do not need to specify an APK file at all. You capabilities should be the following:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("browserName", "");
capabilities.setCapability("platformName","Android");
capabilities.setCapability("appActivity", "<your-android-activity>");
capabilities.setCapability("appPackage", "<your-android-package>");
driver = new AndroidDriver(new URL("http://<url-to-your-appium-server>:4723/wd/hub"), capabilities);

Capabilities appActivityappPackage 在这种情况下是强制性的,当没有指定功能 app

Capabilities appActivity and appPackage are mandatory in this case when not specifying capability app!

来自 Appium 文档:

  • Capability appActivity:要从包中启动的 Android 活动的活动名称.这通常需要以 .(例如,.MainActivity 而不是 MainActivity).

  • Capability appActivity: Activity name for the Android activity you want to launch from your package. This often needs to be preceded by a . (e.g., .MainActivity instead of MainActivity).

Capability appPackage:您要运行的 Android 应用程序的 Java 包,例如 com.example.android.myApp.

Capability appPackage: Java package of the Android app you want to run, like com.example.android.myApp.

这篇关于我有一个已安装的 apk,但我无法在 mac 上使用带有文件资源管理器的 USB 找到它的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆