I am trying to run a simple script, which launches an app. This worked fine when I was using Android 6.0 but fails on android 7.0
This is the script -
DesiredCapabilities capabilities= new DesiredCapabilities();
capabilities.setCapability("deviceName","Moto G4 Plus");
capabilities.setCapability("platformName","Android");
capabilities.setCapability("platformVersion","7.0.");
capabilities.setCapability("appPackage","com.bigbasket.mobileapp");
capabilities.setCapability("appActivity","com.bigbasket.mobileapp.activity.HomeActivity");
AndroidDriver driver= new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
Thread.sleep(4000);
This is the error Log -
error: Failed to start an Appium session, err was: Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "C:\Users\gadiisha\AppData\Local\Android\android-sdk\platform-tools\adb.exe -s ZY2237WRTC install "D:\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk"" Failed to install D:\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]
info: [debug] Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "C:\Users\gadiisha\AppData\Local\Android\android-sdk\platform-tools\adb.exe -s ZY2237WRTC install "D:\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk"" Failed to install D:\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]
at ChildProcess.exithandler (child_process.js:751:12) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1016:16) at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c \"C:\Users\gadiisha\AppData\Local\Android\android-sdk\platform-tools\adb.exe -s ZY2237WRTC install \"D:\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk\"\"\nFailed to install D:\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]\r\n)","killed":false,"code":1,"signal":null,"cmd":"C:\WINDOWS\system32\cmd.exe /s /c \"C:\Users\gadiisha\AppData\Local\Android\android-sdk\platform-tools\adb.exe -s ZY2237WRTC install \"D:\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk\"\"","origValue":"Command failed: C:\WINDOWS\system32\cmd.exe /s /c \"C:\Users\gadiisha\AppData\Local\Android\android-sdk\platform-tools\adb.exe -s ZY2237WRTC install \"D:\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk\"\"\nFailed to install D:\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]\r\n"},"sessionId":null} info: <-- POST /wd/hub/session 500 10506.783 ms - 1306
Details - 1. Appium for windows 2. appium version 1.4.16.1 3. eclipse (luna)
Solutions I have tried so far -
Upgraded to the latest version of Appium - 1.6.5 (it didnt work so I downgraded to Appium 1.4.16.1
deleted appium settings and unlock folders from the mobile device.
deleted the app and then restarted the appium server and ran the scripts again after that
I have seen similar question on the portal but all of them just have lengthy discussions without proper solutions. Please help me to close this issue. Thanks