Failed to start an Appium session, err was: Error: Bad app

error: Failed to start an Appium session, err was: Error: Bad app: E:\Selenium\WorkSpace\AppiumSample\E:\Selenium\WorkSpace\AppiumSample\src\BookMyShow.apk. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Error locating the app: ENOENT, stat ‘E:\Selenium\WorkSpace\AppiumSample\E:\Selenium\WorkSpace\AppiumSample\src\BookMyShow.apk’

info: [debug] Error: Bad app: E:\Selenium\WorkSpace\AppiumSample\E:\Selenium\WorkSpace\AppiumSample\src\BookMyShow.apk. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Error locating the app: ENOENT, stat 'E:\Selenium\WorkSpace\AppiumSample\E:\Selenium\WorkSpace\AppiumSample\src\BookMyShow.apk'
at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:56:13)
at C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\device.js:82:16
at FSReqWrap.oncomplete (fs.js:95:15)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Bad app: E:\Selenium\WorkSpace\AppiumSample\E:\Selenium\WorkSpace\AppiumSample\src\BookMyShow.apk. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Error locating the app: ENOENT, stat 'E:\Selenium\WorkSpace\AppiumSample\E:\Selenium\WorkSpace\AppiumSample\src\BookMyShow.apk')","origValue":"Bad app: E:\Selenium\WorkSpace\AppiumSample\E:\Selenium\WorkSpace\AppiumSample\src\BookMyShow.apk. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Error locating the app: ENOENT, stat 'E:\Selenium\WorkSpace\AppiumSample\E:\Selenium\WorkSpace\AppiumSample\src\BookMyShow.apk'"},"sessionId":null}
info: <-- POST /wd/hub/session 500 33.841 ms - 896 

please help for resolve this error after running script

Do you see BookMyShow.apk after running the following command ?

ls E:\Selenium\WorkSpace\AppiumSample\E:\Selenium\WorkSpace\AppiumSample\src\

try this
String apkpath=“D:\latest Android Apps\Test.apk”;
File app=new File(apkpath);
capabilities.setCapability(“app”, app.getAbsolutePath());

2 Likes

Oh!..MY GOD !!!..CoolSamVJ , you saved me alot…

Your Suggestion worked.

My Code:
String apkpath=“E:\Downloads For Selenium\Appium\BookMyShow.apk”;
File app=new File(apkpath);

DesiredCapabilities capab = new DesiredCapabilities();
capab.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());

Hi all,
I am not able to load app using appium 1.6.5. Its gives Bad app error. Even My path is correct. I tried installing same app using ideviceinstaller through terminal and it got installed successfully. But when I tried using eclipse it gives bad app error. I am using appium 1.6.5, Xcode 8.2.1.
This is what log shows: e[31merrore[39m: Failed to start an Appium session, err was: Error: Bad app: /Users/hiralpatel/Documents/Builds/Regression_Builds/iOS/AugustRelease/Avis_11.2_2sep.ipa. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Command failed: /bin/sh -c find /var/folders/_g/t_znqd0d2w7f5qdx38rsm1kw0000gr/T/117527-6577-1hfb8wc -type d -name '.app’ | xargs rm -rf /var/folders/_g/t_znqd0d2w7f5qdx38rsm1kw0000gr/T/117527-6577-1hfb8wc/Payload
/bin/sh: xargs: command not found
/bin/sh: find: command not found

Please help me to fix this.

This code worked for me… thank u