0

I want to extract UUID from .mobileprovision file but unable to do that.

I tried xml2js, provision and diffrent modules of nodejs to achieve this and I also tried this https://gist.github.com/benvium/2568707 but did not get any success.

Martin Evans
  • 45,791
  • 17
  • 81
  • 97

1 Answers1

1

This works just fine for me:

const provisioning = require('provisioning');

provisioning('XXX.mobileprovision', (err, obj) => {
  if (err) throw err; // TODO: handle better
  console.log(obj.UUID);
});

Uses the provisioning module.

robertklep
  • 198,204
  • 35
  • 394
  • 381
  • 1
    Thank you for the response i tried this but it throws this error `Error: Command failed: Error reading S/MIME message 140160313910928:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:157: at ChildProcess.exithandler (child_process.js:637:15) at ChildProcess.EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:743:16) at Process.ChildProcess._handle.onexit (child_process.js:810:5) ` – Zain Abbas May 11 '16 at 10:59
  • @ZainAbbas I've ran it against various mobileprovision files I have and it works just fine for me, so I'm afraid I can't help you solve that error. Where is the file that you're trying to parse coming from? – robertklep May 11 '16 at 11:05