How to launch pre-existing app using Appium

1,549 views
Skip to first unread message

sol...@gmail.com

unread,
Aug 5, 2014, 8:12:50 PM8/5/14
to appium-...@googlegroups.com
Hi, I already have an app that I want to test installed on my device. However, appium asks for appActivity, appPackage and stuff.

How do I set the DesiredCapabilities so that I can test per-existing app

sol...@gmail.com

unread,
Aug 5, 2014, 9:10:20 PM8/5/14
to appium-...@googlegroups.com
In my log it says

"error: Failed to start an Appium session, err was: Error: No app set; either start appium with --app or pass in an 'app' value in desired capabilities, or set androidPackage to launch pre-existing app on device"

but I couldn't find any information on androidPackage

Isaac Murchie

unread,
Aug 6, 2014, 11:32:29 AM8/6/14
to sol...@gmail.com, appium-...@googlegroups.com
What desired capabilities are you setting. Not having "app" set, but having "appPackage" and "appActivity" ought to work.


--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/d/optout.

sol...@gmail.com

unread,
Aug 6, 2014, 12:16:36 PM8/6/14
to appium-...@googlegroups.com, sol...@gmail.com
This is what I have right now

private static AppiumDriver driver;

    public static void setUp() throws Exception {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities = DesiredCapabilities.android();
       
        capabilities.setCapability("platformName", "Android");
        capabilities.setCapability("platformVersion", "4.4");
        capabilities.setCapability("deviceName", "Device");

        try {
            driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"),
                    capabilities);
        } catch (Exception e) {

        }
    }

I never tested an app before so how would I set appPackage and appActivity for an app that is already installed in the device?

Isaac Murchie

unread,
Aug 6, 2014, 12:35:36 PM8/6/14
to sol...@gmail.com, appium-...@googlegroups.com
capabilities.setCapability("appPackage", package);
capabilities.setCapability("appActivity", activity);

Where package and activity are whatever package and activity you want to launch, from the app you've already installed (something like "com.mycompany.fancyandroidapp" and ".LaunchActivity", respectively). This should be in the AndroidManifest for the app.


--
Reply all
Reply to author
Forward
0 new messages