How do I write to the Android emulator using Jenkins

Firstly I'm assuming the problem is due to Jenkins not having permissions to write to the Android Emulator. So that might be the first thing I would like to know. But here's the background of what I am doing, please also note that all of this works fine outside of Jenkins. The other thing to note is I have setup Jenkins to run as a service.

I have a job running in Jenkins, PULL_SCREENSHOT that installs an application and runs some tests on the Android emulator, as I've stated I'm using the Android Emulator Plugin for Jenkins. In the emulator config section of the Jenkins job I'm using an existing Device that I have created using ADB.exe. The problem I'm having is the tests are supposed to create a screenshots directory using this code.

final String path = Environment.getExternalStorageDirectory()+ "/screenshots/";

                            File dir = new File(path);

                            if (!dir.exists()) 
                            {
                                dir.mkdirs();
                            }

But this directory isn't created, I've looked through the file system to see if it appeared somewhere different than normal but no luck.

This is the error from the Jenkins console.

*usersjamiemirl.jenkinsjobsPULL_SCREENSHOTSworkspace>adb pull /sdcard/screenshots c:/screenshots/ remote object '/sdcard/screenshots' does not exist users.jenkinsjobsPULL_SCREENSHOTSworkspace>exit 1 Build step 'Execute Windows batch command' marked build as failure Finished: FAILURE*

链接地址: http://www.djcxy.com/p/66392.html

上一篇: 如何在Jenkins中将写入权限分开到Maven仓库?

下一篇: 我如何使用Jenkins写入Android模拟器