-3

I am working on android project and i want to retrieve the android version name from manifest file using power shell or perl command. here is my manifest file

<?xml version="1.0" encoding="utf-8"?><manifest android:versionCode="27" android:versionName="1.0.1.42" package="com.shure.motiv" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

my android version name is 1.0.1.42. How do i retrieve the 1.0.1.42 and set as the environment variable. Please can you anyone help me on the same.

PerlDuck
  • 5,610
  • 3
  • 20
  • 39
krishna
  • 15
  • 2
  • 7

1 Answers1

0

A batch file which uses powershell may cover two of your tagged options:

@For /F %%A In ('Powershell -C "[xml]$fC=Get-Content 'AndroidManifest.xml';"^
 "$fC.manifest.versionName"') Do @Set "versionName=%%A"
@Echo %versionName%
@Pause

Please note, that because you've made absolutely no attempt to create any code, no tutoring will be entered into with reference to the above.

Compo
  • 36,585
  • 5
  • 27
  • 39