Inside my androidTest I create a custom text file
File dir = new File(Environment.getExternalStorageDirectory() + "/TestResults");
logFile = new File(dir.getAbsolutePath() + "result.txt");
if (!logFile.exists())
{
try
{
dir.mkdirs();
logFile.createNewFile();
}
catch (IOException e)
{
e.printStackTrace();
}
}
and during the test run I write some custom data there. When I run test locally on the emulator, I can see the file created and I can pull it using
adb pull /sdcard/TestResults/result.txt
But when I run the same test inside Jenkins build step
echo pulling test result file
cd %LocalDir%\Android\sdk\platform-tools
adb.exe pull /sdcard/TestResults/result.txt D:\ANDROID_TEST_DATA\
and try to pull the file, I get:
pulling test result file
adb: error: remote object '/sdcard/TestResults/result.txt' does not exist
Build step 'Execute Windows batch command' marked build as failure
[android] Stopping Android emulator
Any ideas, how this could be fixed?
Update
Also tried paths:
/storage/emulated/0/TestResults/result.txt
/mnt/sdcard/TestResults/result.txt