@@ -74,6 +74,7 @@ export class PlatformService implements IPlatformService {
7474
7575 var downloadedPackagePath = this . $npm . install ( packageToInstall , npmOptions ) . wait ( ) ;
7676 var frameworkDir = path . join ( downloadedPackagePath , constants . PROJECT_FRAMEWORK_FOLDER_NAME ) ;
77+ frameworkDir = path . resolve ( frameworkDir ) ;
7778
7879 try {
7980 this . addPlatformCore ( platformData , frameworkDir ) . wait ( ) ;
@@ -92,7 +93,7 @@ export class PlatformService implements IPlatformService {
9293 platformData . platformProjectService . createProject ( platformData . projectRoot , frameworkDir ) . wait ( ) ;
9394 var installedVersion = this . $fs . readJson ( path . join ( frameworkDir , "../" , "package.json" ) ) . wait ( ) . version ;
9495
95- if ( options . frameworkPath && ! options . symlink ) {
96+ if ( options . frameworkPath && this . $fs . getFsStats ( options . frameworkPath ) . wait ( ) . isFile ( ) && ! options . symlink ) {
9697 // Need to remove unneeded node_modules folder
9798 // One level up is the runtime module and one above is the node_modules folder.
9899 this . $fs . deleteDirectory ( path . join ( frameworkDir , "../../" ) ) . wait ( ) ;
@@ -217,7 +218,10 @@ export class PlatformService implements IPlatformService {
217218
218219 var platformData = this . $platformsData . getPlatformData ( platform ) ;
219220
221+ var cachedDeviceOption = options . forDevice ;
222+ options . forDevice = true ;
220223 this . buildPlatform ( platform ) . wait ( ) ;
224+ options . forDevice = cachedDeviceOption ;
221225
222226 packageFile = this . getLatestApplicationPackageForDevice ( platformData ) . wait ( ) . packageName ;
223227 this . $logger . out ( "Using " , packageFile ) ;
@@ -261,7 +265,10 @@ export class PlatformService implements IPlatformService {
261265
262266 var platformData = this . $platformsData . getPlatformData ( platform ) ;
263267
268+ var cachedDeviceOption = options . forDevice ;
269+ options . forDevice = true ;
264270 this . buildPlatform ( platform ) . wait ( ) ;
271+ options . forDevice = cachedDeviceOption ;
265272
266273 // Get latest package that is produced from build
267274 var packageFile = this . getLatestApplicationPackageForDevice ( platformData ) . wait ( ) . packageName ;
@@ -286,10 +293,7 @@ export class PlatformService implements IPlatformService {
286293 emulatorServices . checkDependencies ( ) . wait ( ) ;
287294
288295 if ( ! options . availableDevices ) {
289- var cachedEmulatorOption = options . emulator ;
290- options . emulator = true ;
291296 this . buildPlatform ( platform ) . wait ( ) ;
292- options . emulator = cachedEmulatorOption ;
293297
294298 var packageFile = this . getLatestApplicationPackageForEmulator ( platformData ) . wait ( ) . packageName ;
295299 this . $logger . out ( "Using " , packageFile ) ;
0 commit comments