The reason Jenkins uses Maven to appear C:\Windows\system32\config\systemprofile is that the account that the Jenkins service initiated uses the system's account number and is converted into a specific desktop user account in the service.
If your command runs fine on Win command prompt as user ' X ' and then you should run Jenkins with the same user.
This can is achieved by performing following steps:
1. Run > Services.msc (Enter)
2. Select Jenkins Service. Right-click and select Properties
3. Click on Log On
tab
4. Select user ' X ' and provide credentials
5. Restart Jenkins
In your case, the user ' X ' seems to being User.Name since the path to AVD as mentioned by/users/user.name/.android
Reference:
Http://stackoverflow.com/questions/25801121/how-to-set-path-in-jenkins-for-directory-having-android-avd
Jenkins uses MAVEN to appear C:\Windows\system32\config\systemprofile solution