File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
packages/@ionic/cli/src/commands/capacitor Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -205,12 +205,16 @@ For Android and iOS, you can setup Remote Debugging on your device with browser
205205 ) ;
206206 }
207207 } else {
208- options [ 'target' ] = await this . env . prompt ( {
209- type : 'list' ,
210- name : 'target' ,
211- message : 'Which device would you like to target?' ,
212- choices : targets . map ( t => ( { name : `${ t . name } (${ t . id } )` , value : t . id } ) ) ,
213- } ) ;
208+ if ( targets . length > 0 ) {
209+ options [ 'target' ] = await this . env . prompt ( {
210+ type : 'list' ,
211+ name : 'target' ,
212+ message : 'Which device would you like to target?' ,
213+ choices : targets . map ( t => ( { name : `${ t . name } (${ t . id } )` , value : t . id } ) ) ,
214+ } ) ;
215+ } else {
216+ throw new FatalException ( `No devices or emulators found` ) ;
217+ }
214218
215219 if ( ! inputs [ 0 ] ) {
216220 throw new FatalException ( `The ${ input ( 'platform' ) } argument is required.` ) ;
You can’t perform that action at this time.
0 commit comments