File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 24
24
"author" : " Shazron Abdullah" ,
25
25
"license" : " MIT" ,
26
26
"dependencies" : {
27
+ "plist" : " ^1.2.0" ,
27
28
"simctl" : " ^0.0.9" ,
28
29
"nopt" : " 1.0.9" ,
29
30
"bplist-parser" : " ^0.0.6"
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ var path = require('path'),
27
27
help = require ( './help' ) ,
28
28
util = require ( 'util' ) ,
29
29
simctl ,
30
- bplist ;
30
+ bplist ,
31
+ plist ;
31
32
32
33
function findFirstAvailableDevice ( list ) {
33
34
/*
@@ -315,11 +316,21 @@ var lib = {
315
316
bplist . parseFile ( info_plist_path , function ( err , obj ) {
316
317
317
318
if ( err ) {
318
- throw err ;
319
- }
319
+ // try to see if a regular plist parser will work
320
+ if ( ! plist ) {
321
+ plist = require ( 'plist' ) ;
322
+ }
323
+ obj = plist . parse ( fs . readFileSync ( info_plist_path , 'utf8' ) ) ;
324
+ if ( obj ) {
325
+ app_identifier = obj . CFBundleIdentifier ;
326
+ } else {
327
+ throw err ;
328
+ }
329
+ } else {
330
+ app_identifier = obj [ 0 ] . CFBundleIdentifier ;
331
+ }
320
332
321
- app_identifier = obj [ 0 ] . CFBundleIdentifier ;
322
- argv = argv || [ ] ;
333
+ argv = argv || [ ] ;
323
334
324
335
// get the deviceid from --devicetypeid
325
336
// --devicetypeid is a string in the form "devicetype, runtime_version" (optional: runtime_version)
You can’t perform that action at this time.
0 commit comments