@@ -6,6 +6,7 @@ import Future = require("fibers/future");
6
6
import * as constants from "../constants" ;
7
7
import * as semver from "semver" ;
8
8
import * as projectServiceBaseLib from "./platform-project-service-base" ;
9
+ import * as androidDebugBridgePath from "../common/mobile/android/android-debug-bridge" ;
9
10
10
11
class AndroidProjectService extends projectServiceBaseLib . PlatformProjectServiceBase implements IPlatformProjectService {
11
12
private static VALUES_DIRNAME = "values" ;
@@ -28,7 +29,8 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
28
29
$projectData : IProjectData ,
29
30
$projectDataService : IProjectDataService ,
30
31
private $sysInfo : ISysInfo ,
31
- private $mobileHelper : Mobile . IMobileHelper ) {
32
+ private $mobileHelper : Mobile . IMobileHelper ,
33
+ private $injector : IInjector ) {
32
34
super ( $fs , $projectData , $projectDataService ) ;
33
35
this . _androidProjectPropertiesManagers = Object . create ( null ) ;
34
36
}
@@ -285,10 +287,11 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
285
287
return Future . fromResult ( ) ;
286
288
}
287
289
288
- public deploy ( device : Mobile . IAndroidDevice , appIdentifier : string ) : IFuture < void > {
290
+ public deploy ( deviceIdentifier : string ) : IFuture < void > {
289
291
return ( ( ) => {
290
- let deviceRootPath = `/data/local/tmp/${ appIdentifier } ` ;
291
- device . adb . executeShellCommand ( [ "rm" , "-rf" , this . $mobileHelper . buildDevicePath ( deviceRootPath , "fullsync" ) ,
292
+ let adb = this . $injector . resolve ( androidDebugBridgePath . AndroidDebugBridge , { identifier : deviceIdentifier } ) ;
293
+ let deviceRootPath = `/data/local/tmp/${ this . $projectData . projectId } ` ;
294
+ adb . executeShellCommand ( [ "rm" , "-rf" , this . $mobileHelper . buildDevicePath ( deviceRootPath , "fullsync" ) ,
292
295
this . $mobileHelper . buildDevicePath ( deviceRootPath , "sync" ) ,
293
296
this . $mobileHelper . buildDevicePath ( deviceRootPath , "removedsync" ) ] ) . wait ( ) ;
294
297
} ) . future < void > ( ) ( ) ;
0 commit comments