Appium unable to launch app activity for android emulator

Hi,
I m installing app on emulator through appium. Though i have provided package name, activity name still it unable to launch activity, though my app is get installed on emulator.

Please tell me how to launch activity for app.

capabilities.setCapability(“appPackage”, “com.ning.phoenix”); // This is package name of your app (you can get it from apk info app)
capabilities.setCapability(“appActivity”, “.Ning”);
capabilities.setCapability(“appWaitPackage”, “com.ning.phoenix”);
capabilities.setCapability(“appWaitActivity”, “.Ning”);

     capabilities.setCapability("intentAction", "android.intent.action.MAIN");
     capabilities.setCapability("intentCategory", "android.intent.category.LAUNCHER");
     capabilities.setCapability("intentFlags", "0x10200000");

Does your app crash while starting up??? or what exactly happens when you run Appium??? Please provide Appium logs…

Thanks for replay.

No App doesn’t get crashed… Also my Test run smoothly with installing app but without launching activity.

providing logs in attached fileAppium_log.txt (16.2 KB)

Probably because you have set the server to shut down after 60 seconds if it didn’t receive any command. Try to increase that value and also try to start the emulator before the test and just connect to it.

Though i have increased my timeout, still it doesn’t show launcher activity. emulator is already open before i run my test script

driver.manage().timeouts().implicitlyWait(200, TimeUnit.SECONDS );

I was not referring to the implicit wait of Selenium, Please increase the value of the following server configuration:

–command-timeout

Note that the value is in milliseconds.

Hi Hassan,
really appreciate for your quick response.

Though i tried all solutions given by you( Setting , capabilities.setCapability(“command-timeout”, 200); ). it still not working… as i observed after executing these line in appium

info: [debug] executing: “C:\Android\android-sdk\platform-tools\adb.exe” -s 4100751d72952100 shell “am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.ning.phoenix/.Ning”
info: [debug] Waiting for pkg “com.ning.phoenix” and activity “.Ning” to be focused
info: [debug] Getting focused package and activity
i observed only blank screen is shown… and after that home key is pressed.

I m providing my code for your reference. please have a look. Let me know i m doing some mistake or notNing_Script.txt (3.1 KB)

i obser ved

Enable showing the time-stamp in Appium log and try again to see the time difference between starting and ending the session.
Also try removing appWaitPackage and appWaitActivity capabilities.

I enable timestamp in desired capability “capabilities.setCapability(“logTimestamp”, true);”
check time difference between start & end session ( it approx 1 min ). & removed wait package & wait activity. set command-timeout to 200.

Still no luck.

0

In the log you provided, I noticed the following:

Setting command timeout to the default of 60 secs

Although you have set it to a larger value. I guess it might be a bug in the Appium 1.2.4 version. Please update to the latest server version and client version and check again.

Hi,
On Mac i m using latest version of appium ( 1.3.1 ) & Java-client library 1.5.0.( As the latest one one is 2. 0 but there is problem while initialing Appium driver instance( refer : http://stackoverflow.com/questions/26715642/cannot-instantiate-the-type-appiumdriver ). so using java-client library 1.5.0

but still i m facing same problem… unless until this issue solved i can’t proceed further. :frowning:

though i have latest version of appium.

I have provided .apk file in previous reply… so is it possible for you to run at your side through code. check it it working fine with your emulator.

I replied in the StackOverflow question with the correct answer. Please, update to the latest client version 2.0.0. and try again.

HI,
As per your suggestion, i update appium client library to 2.0 and changed AppiumDriver to AndroidDriver as per java client doc. Now both Appium & Java client has latest version still i m not able to launch activity. i can see in log activity is getting focused but i is not showing on emulator by below code.

info: [debug] executing: “/Applications/Android/sdk/platform-tools/adb” -s emulator-5554 shell “am start -S -a .MAIN -c .LAUNCHER -f 0x10200000 -n com.ning.phoenix/.Ning”

info: [debug] Waiting for pkg “com.ning.phoenix” and activity “.Ning” to be focused
info: [debug] Getting focused package and activity
info: [debug] executing: “/Applications/Android/sdk/platform-tools/adb” -s emulator-5554 shell “dumpsys window windows”

bt still no luck to show my activity on emulator… screen just get blank… and then press Home button through appium log. Also one thing i want to tell you when i do provided all the values in Android Setting in Appium and prelaunch application through appium then it shows my launch able activity in emulator… but when i run my script through appium it is not showing luanchable activity.

If possible for you can you please try at your end.

Observed the same problem in my setup also.

Hi @pallavikolekar did you find the solution for this issue. if yes, please share the steps or procedure to resolve the issue