@@ -111,12 +111,8 @@ declare module Mobile {
111111 }
112112
113113 interface IiOSDevice extends IDevice {
114- getLiveSyncSocket ( appId : string ) : Promise < any > ;
115- destroyLiveSyncSocket ( appId : string ) : void ;
116-
117- getDebugSocket ( appId : string ) : Promise < any > ;
114+ getDebugSocket ( appId : string , projectName : string ) : Promise < any > ;
118115 destroyDebugSocket ( appId : string ) : void ;
119-
120116 openDeviceLogStream ( options ?: IiOSLogStreamOptions ) : Promise < void > ;
121117 destroyAllSockets ( ) : void ;
122118 }
@@ -221,12 +217,6 @@ declare module Mobile {
221217 * @param {string } projectName The project name of the currently running application for which we need the logs.
222218 */
223219 setProjectNameForDevice ( deviceIdentifier : string , projectName : string ) : void ;
224-
225- /**
226- * Disables logs on the specified device and does not print any logs on the console.
227- * @param {string } deviceIdentifier The unique identifier of the device.
228- */
229- muteLogsForDevice ( deviceIdentifier : string ) : void ;
230220 }
231221
232222 /**
@@ -248,10 +238,6 @@ declare module Mobile {
248238 */
249239 projectName ?: string ;
250240
251- /**
252- * Specifies if the logs will be printed on the console.
253- */
254- muteLogs ?: boolean ;
255241 }
256242
257243 /**
@@ -311,19 +297,28 @@ declare module Mobile {
311297 justLaunch ?: boolean ;
312298 }
313299
300+ interface IStartApplicationData extends IApplicationData {
301+ waitForDebugger : boolean ;
302+ enableDebugging : boolean ;
303+ }
304+
314305 interface IInstallAppData extends IApplicationData {
315306 packagePath : string ;
316307 }
317308
309+ interface IRunningAppInfo {
310+ pid : string ;
311+ }
312+
318313 interface IDeviceApplicationManager extends NodeJS . EventEmitter {
319314 getInstalledApplications ( ) : Promise < string [ ] > ;
320315 isApplicationInstalled ( appIdentifier : string ) : Promise < boolean > ;
321316 installApplication ( packageFilePath : string , appIdentifier ?: string ) : Promise < void > ;
322317 uninstallApplication ( appIdentifier : string ) : Promise < void > ;
323318 reinstallApplication ( appIdentifier : string , packageFilePath : string ) : Promise < void > ;
324- startApplication ( appData : IApplicationData ) : Promise < void > ;
319+ startApplication ( appData : IStartApplicationData ) : Promise < IRunningAppInfo > ;
325320 stopApplication ( appData : IApplicationData ) : Promise < void > ;
326- restartApplication ( appData : IApplicationData ) : Promise < void > ;
321+ restartApplication ( appData : IStartApplicationData ) : Promise < IRunningAppInfo > ;
327322 checkForApplicationUpdates ( ) : Promise < void > ;
328323 isLiveSyncSupported ( appIdentifier : string ) : Promise < boolean > ;
329324 getApplicationInfo ( applicationIdentifier : string ) : Promise < Mobile . IApplicationInfo > ;
@@ -550,6 +545,27 @@ declare module Mobile {
550545 * @returns {Promise<string[]> } - Returns array of errors.
551546 */
552547 startEmulator ( options ?: IStartEmulatorOptions ) : Promise < string [ ] > ;
548+
549+ /**
550+ * Returns a single device based on the specified options. If more than one devices are matching,
551+ * prompts the user for a manual choice or returns the first one for non interactive terminals.
552+ */
553+ pickSingleDevice ( options : IPickSingleDeviceOptions ) : Promise < Mobile . IDevice >
554+ }
555+
556+ interface IPickSingleDeviceOptions {
557+ /**
558+ * Pick from the connected emulators only
559+ */
560+ onlyEmulators : boolean ;
561+ /**
562+ * Pick from the connected real devices only
563+ */
564+ onlyDevices : boolean ;
565+ /**
566+ * Pick a specific device
567+ */
568+ deviceId : string ;
553569 }
554570
555571 interface IListEmulatorsOptions {
@@ -941,14 +957,6 @@ declare module Mobile {
941957 * @returns {net.Socket } Returns instance of net.Socket when connection is successful, otherwise undefined is returned.
942958 */
943959 connectToPort ( connectToPortData : IConnectToPortData ) : Promise < any > ;
944-
945- /**
946- * Runs an application on emulator
947- * @param app The path to executable .app
948- * @param emulatorOptions Emulator options that can be passed
949- * @returns {Promise<any> } Returns the appId with the process of the running application on the simulator. For example: org.nativescript.myapp 55434
950- */
951- runApplicationOnEmulator ( app : string , emulatorOptions ?: IRunApplicationOnEmulatorOptions ) : Promise < any > ;
952960 }
953961
954962 interface IEmulatorSettingsService {
@@ -1251,9 +1259,9 @@ interface IIOSDeviceOperations extends IDisposable, NodeJS.EventEmitter {
12511259
12521260 deleteFiles ( deleteArray : IOSDeviceLib . IDeleteFileData [ ] , errorHandler ?: DeviceOperationErrorHandler ) : Promise < IOSDeviceResponse > ;
12531261
1254- start ( startArray : IOSDeviceLib . IDdiApplicationData [ ] , errorHandler ?: DeviceOperationErrorHandler ) : Promise < IOSDeviceResponse > ;
1262+ start ( startArray : IOSDeviceLib . IIOSApplicationData [ ] , errorHandler ?: DeviceOperationErrorHandler ) : Promise < IOSDeviceResponse > ;
12551263
1256- stop ( stopArray : IOSDeviceLib . IDdiApplicationData [ ] , errorHandler ?: DeviceOperationErrorHandler ) : Promise < IOSDeviceResponse > ;
1264+ stop ( stopArray : IOSDeviceLib . IIOSApplicationData [ ] , errorHandler ?: DeviceOperationErrorHandler ) : Promise < IOSDeviceResponse > ;
12571265
12581266 postNotification ( postNotificationArray : IOSDeviceLib . IPostNotificationData [ ] , errorHandler ?: DeviceOperationErrorHandler ) : Promise < IOSDeviceResponse > ;
12591267
0 commit comments