question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Appium APK deployment fails: no such file or directory

See original GitHub issue

I have a Xamarin forms android app which when deployed from Visual Studio deploys fine. However, I’m now trying to test this using Appium but failing to even get the APK to deploy. I can see it uninstalls any old version of the app successfully (when present), pushes the APK to the device but then if fails with a file not found exception!

Has anyone come across this problem before?

Here is a full log output

    The server is running
        
        [Appium] Welcome to Appium v1.6.5
        [Appium] Appium REST http interface listener started on 0.0.0.0:4723
        [HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"deviceName":"988627455243304541","platformVersion":"7.1","fullReset":"False","platformName":"Android","app":"D:\\MyAppName\\Artefacts\\com.MyAppName.apk"}}
        [MJSONWP] Calling AppiumDriver.createSession() with args: [{"deviceName":"988627455243304541","platformVersion":"7.1","fullReset":"False","platformName":"Android","app":"D:\\MyAppName\\Artefacts\\com.MyAppName.apk"},null,null]
        [BaseDriver] Event 'newSessionRequested' logged at 1505825663383 (13:54:23 GMT+0100 (GMT Summer Time))
        [Appium] Creating new AndroidDriver (v1.20.0) session
        [Appium] Capabilities:
        [Appium]   deviceName: '988627455243304541'
        [Appium]   platformVersion: '7.1'
        [Appium]   fullReset: 'False'
        [Appium]   platformName: 'Android'
        [Appium]   app: 'D:\\MyAppName\\Artefacts\\com.MyAppName.apk'
        [AndroidDriver] AndroidDriver version: 1.20.0
        [BaseDriver] Capability 'fullReset' changed from string to boolean. This may cause unexpected behavior
        [BaseDriver] Session created with session id: 6a063377-4484-4c8a-b12c-e377bd77d9c7
        [AndroidDriver] Getting Java version
        [AndroidDriver] Java version is: 1.8.0_131
        [ADB] Checking whether adb is present
        [ADB] Using adb.exe from C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe
        [AndroidDriver] Retrieving device list
        [ADB] Trying to find a connected android device
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [AndroidDriver] Looking for a device with Android '7.1'
        [ADB] Setting device id to emulator-5554
        [ADB] Getting device platform version
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.build.version.release"]
        [AndroidDriver] Using device: emulator-5554
        [ADB] Checking whether adb is present
        [ADB] Using adb.exe from C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe
        [ADB] Setting device id to emulator-5554
        [BaseDriver] Using local app 'D:\MyAppName\Artefacts\com.MyAppName.apk'
        [AndroidDriver] Checking whether app is actually present
        [AndroidDriver] Starting Android session
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","wait-for-device"]
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","echo","ping"]
        [Logcat] Starting logcat capture
        [AndroidDriver] Pushing settings apk to device...
        [ADB] Getting install status for io.appium.settings
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","list","packages","io.appium.settings"]
        [ADB] App is installed
        [ADB] Getting package info for io.appium.settings
        [ADB] Getting connected devices...
        [ADB] Checking whether aapt is present
        [ADB] Using aapt.exe from C:\Program Files (x86)\Android\android-sdk\build-tools\19.1.0\aapt.exe
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","dumpsys","package","io.appium.settings"]
        [ADB] Cannot read version codes of C:\Users\myprofile\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\io.appium.settings\app\build\outputs\apk\settings_apk-debug.apk and/or io.appium.settings. Assuming correct app version is already installed
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.build.version.sdk"]
        [ADB] Device API level: 25
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","dumpsys","package","io.appium.settings"]
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","dump","io.appium.settings"]
        [ADB] Got the following command chunks to execute: pm,grant,io.appium.settings,android.permission.WRITE_SETTINGS,;,pm,grant,io.appium.settings,android.permission.ACCESS_MOCK_LOCATION,;
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","grant","io.appium.settings","android.permission.WRITE_SETTINGS",";","pm","grant","io.appium.settings","android.permission.ACCESS_MOCK_LOCATION",";"]
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","grant","io.appium.settings","android.permission.WRITE_SETTINGS",";","pm","grant","io.appium.settings","android.permission.ACCESS_MOCK_LOCATION",";"]
        [AndroidDriver] Pushing unlock helper app to device...
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","install","C:\\Users\\myprofile\\AppData\\Local\\Programs\\appium-desktop\\resources\\app\\node_modules\\appium\\node_modules\\appium-unlock\\bin\\unlock_apk-debug.apk"]
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","install","C:\\Users\\myprofile\\AppData\\Local\\Programs\\appium-desktop\\resources\\app\\node_modules\\appium\\node_modules\\appium-unlock\\bin\\unlock_apk-debug.apk"]
        [ADB] Application 'C:\Users\myprofile\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-unlock\bin\unlock_apk-debug.apk' already installed. Continuing.
        [ADB] Device API level: 25
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","appops","set","io.appium.settings","android:mock_location","allow"]
        [ADB] Getting device platform version
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.build.version.release"]
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","wm","size"]
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.product.model"]
        [ADB] Current device property 'ro.product.model': Android SDK built for x86_64
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.product.manufacturer"]
        [ADB] Current device property 'ro.product.manufacturer': unknown
        [AndroidDriver] Parsing package and activity from app manifest
        [ADB] Checking whether aapt is present
        [ADB] Using aapt.exe from C:\Program Files (x86)\Android\android-sdk\build-tools\19.1.0\aapt.exe
        [ADB] Extracting package and launch activity from manifest
        [ADB] badging package: com.MyAppName
        [ADB] badging act: md5ef933d9409042c1b8811416629afef59.MainActivity
        [AndroidDriver] Parsed package and activity are: com.MyAppName/md5ef933d9409042c1b8811416629afef59.MainActivity
        [AndroidDriver] Remote apk path is /data/local/tmp/d36e508419e64bb676246321b90613d4.apk
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","ls","/data/local/tmp/d36e508419e64bb676246321b90613d4.apk"]
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","ls","/data/local/tmp/d36e508419e64bb676246321b90613d4.apk"]
        [AndroidDriver] Checking if app is installed
        [ADB] Getting install status for com.MyAppName
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","list","packages","com.MyAppName"]
        [ADB] App is not installed
        [AndroidDriver] Apk is not yet installed
        [AndroidDriver] installing apk from remote
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","mkdir","-p","/data/local/tmp"]
        [AndroidDriver] Clearing out any existing remote apks with the same hash
        [AndroidDriver] Removing any old apks
        [AndroidDriver] Except ["d36e508419e64bb676246321b90613d4"]
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","ls","/data/local/tmp/*.apk"]
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","ls","/data/local/tmp/*.apk"]
        [AndroidDriver] No apks to examine
        [AndroidDriver] Pushing com.MyAppName to device. Will wait up to 90000 milliseconds before aborting
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","push","D:\\MyAppName\\Artefacts\\com.MyAppName.apk","/data/local/tmp/d36e508419e64bb676246321b90613d4.apk"]
        [HTTP] <-- POST /wd/hub/session - - ms - - 
        [ADB] Uninstalling com.MyAppName
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","am","force-stop","com.MyAppName"]
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","uninstall","com.MyAppName"]
        [ADB] App was not uninstalled, maybe it wasn't on device?
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","install","-r","/data/local/tmp/d36e508419e64bb676246321b90613d4.apk"]
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","install","-r","/data/local/tmp/d36e508419e64bb676246321b90613d4.apk"]
        [AndroidDriver] Installing remote APK failed, going to uninstall and try again
        [AndroidDriver] Removing any old apks
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","ls","/data/local/tmp/*.apk"]
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","push","D:\\MyAppName\\Artefacts\\com.MyAppName.apk","/data/local/tmp/d36e508419e64bb676246321b90613d4.apk"]
        [ADB] Uninstalling com.MyAppName
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","am","force-stop","com.MyAppName"]
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","uninstall","com.MyAppName"]
        [ADB] App was not uninstalled, maybe it wasn't on device?
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","install","-r","/data/local/tmp/d36e508419e64bb676246321b90613d4.apk"]
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","pm","install","-r","/data/local/tmp/d36e508419e64bb676246321b90613d4.apk"]
        [AndroidDriver] Installing remote APK failed, going to uninstall and try again
        [AndroidDriver] Removing any old apks
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","ls","/data/local/tmp/*.apk"]
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","ls","/data/local/tmp/*.apk"]
        [AndroidDriver] No apks to examine
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","push","D:\\MyAppName\\Artefacts\\com.MyAppName.apk","/data/local/tmp/d36e508419e64bb676246321b90613d4.apk"]
        [AndroidDriver] Shutting down Android driver
        [AndroidDriver] Called deleteSession but bootstrap wasn't active
        [Logcat] Stopping logcat capture
        [ADB] Getting connected devices...
        [ADB] 1 device(s) connected
        [ADB] Running 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","emulator-5554","shell","am","force-stop","io.appium.unlock"]
        [AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
        [MJSONWP] Encountered internal error running command: Error: Error executing adbExec. Original error: 'Command ''C:\\Program Files (x86)\\Android\\android-sdk\\platform-tools\\adb.exe' -P 5037 -s emulator-5554 shell pm install -r /data/local/tmp/d36e508419e64bb676246321b90613d4.apk' exited with code 1'; Stderr: 'Error: failed to write; /data/local/tmp/d36e508419e64bb676246321b90613d4.apk (No such file or directory)'; Code: '1'
            at ADB.execFunc$ (C:\Users\myprofile\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\system-calls.js:228:13)
            at tryCatch (C:\Users\myprofile\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
            at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\myprofile\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
            at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\myprofile\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
            at GeneratorFunctionPrototype.invoke (C:\Users\myprofile\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
            at process._tickCallback (internal/process/next_tick.js:103:7)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
mykola-mokhnachcommented, Sep 26, 2017

Delete the extra space at the end of capability name

0reactions
lock[bot]commented, Apr 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Appium APK deployment fails: no such file or directory - Support
I have a Xamarin forms android app which when deployed from Visual Studio deploys fine. However, I'm now trying to test this using...
Read more >
Unhandled error:Error: ENOENT, no such file or directory ...
Hello,. I am using Appium 1.3.7. on windows .it was working properly few days back but today when i accessed it it gave...
Read more >
UNC path to .apk file triggered error - Appium Discuss
In C#, I've set Desired Capabilities "app" pointing to an unc .apk file path. ... stat '\\\\server\\shared\\dropbox\\example.apk': No such file or directory
Read more >
Why I can run appium.js in terminal but failed using java with ...
IOException: Cannot run program “appium.js” (in directory “/Applications/Appium.app/Contents/Resources/node_modules/appium/bin”): error=2, No such file or ...
Read more >
ENOENT: no such file or directory when running npm install ...
My simple solution for this error: "npm WARN tar ENOENT:no such file or directory. Not only for ENOENT if all files in npm...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found