-
Bug
-
Resolution: Incomplete
-
Major
-
None
-
Jenkins 2.1
Android SDK is configured on slave agent, Ubuntu Server LTS 14.04
11:46:06 $ /home/jenkins/android/tools/android list target 11:46:07 [android] Using Android SDK: /home/jenkins/android 11:46:07 [android] Creating Android AVD: /tmp/.android/avd/hudson_pl-PL_320_768x1280_Google_Inc._Google_APIs_17_armeabi-v7a_-jars-test.avd 11:46:07 [android] /home/jenkins/android/tools/android create avd -f -a -c 64M -s 768x1280 -n hudson_pl-PL_320_768x1280_Google_Inc._Google_APIs_17_armeabi-v7a_-jars-test -t "Google Inc.:Google APIs:17" --abi armeabi-v7a 11:46:08 [android] Could not create Android emulator: Failed to parse AVD config file
I checked source code of plugin, and the only place where '/tmp' directory is being set is at
https://github.com/jenkinsci/android-emulator-plugin/blob/master/src/main/java/hudson/plugins/android_emulator/util/Utils.java#L284
I investigated this further by creating simple jar, which was then ran in 'execute shell' build step..
public class Main { public static void main(String[] args) { System.out.println("home: " + System.getenv("HOME")); System.out.println("username: " + System.getProperty("user.name")); } }
and here is the output:
12:39:13 home: null 12:39:13 username: jenkins
When I execute this jar directly from shell over ssh it works properly.
I have no clue why is it working that way, but have you considered using EnvVars class? It stores all environment variables available on machine, including those injected by plugins / slaves.
http://javadoc.jenkins-ci.org/hudson/EnvVars.html