File tree 4 files changed +43
-14
lines changed
4 files changed +43
-14
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -14,3 +14,41 @@ var fiber = Fiber(() => {
14
14
} ) ;
15
15
16
16
fiber . run ( ) ;
17
+
18
+ global . publicApi = { } ;
19
+
20
+ Object . defineProperty ( global . publicApi , "getRunningSimulator" , {
21
+ get : ( ) => {
22
+ return ( ...args : any [ ] ) => {
23
+ let future = new Future < any > ( ) ;
24
+ let libraryPath = require ( "./iphone-simulator-xcode-7" ) ;
25
+ let simulator = new libraryPath . XCode7Simulator ( ) ;
26
+ let repeatCount = 30 ;
27
+ let timer = setInterval ( ( ) => {
28
+ Fiber ( ( ) => {
29
+ let result = simulator . getBootedDevice . apply ( simulator , args ) . wait ( ) ;
30
+ if ( ( result || ! repeatCount ) && ! future . isResolved ( ) ) {
31
+ clearInterval ( timer ) ;
32
+ future . return ( result ) ;
33
+ }
34
+ repeatCount -- ;
35
+ } ) . run ( ) ;
36
+ } , 500 ) ;
37
+ return future . wait ( ) ;
38
+ }
39
+ }
40
+ } ) ;
41
+
42
+ Object . defineProperty ( global . publicApi , "getApplicationPath" , {
43
+ get : ( ) => {
44
+ return ( ...args : any [ ] ) => {
45
+ let libraryPath = require ( "./simctl" ) ;
46
+ let obj = new libraryPath . Simctl ( )
47
+ let result = obj . getAppContainer . apply ( obj , args ) . wait ( ) ;
48
+ return result ;
49
+ }
50
+ }
51
+ } ) ;
52
+
53
+
54
+ module . exports = global . publicApi ;
Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ export class Simctl implements ISimctl {
37
37
return this . simctlExec ( "notify_post" , [ deviceId , notification ] ) ;
38
38
}
39
39
40
+ public getAppContainer ( deviceId : string , applicationIdentifier : string ) : IFuture < string > {
41
+ return this . simctlExec ( "get_app_container" , [ deviceId , applicationIdentifier ] ) ;
42
+ }
43
+
40
44
public getDevices ( ) : IFuture < IDevice [ ] > {
41
45
return ( ( ) => {
42
46
if ( ! this . devices ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ios-sim-portable" ,
3
- "version" : " 1.0.12-gamma " ,
3
+ "version" : " 1.0.13-beta " ,
4
4
"description" : " " ,
5
5
"main" : " ./lib/ios-sim.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments