# Ionic Server doesn't shutdown gracefully using Cordova

**URL:** <https://forum.ionicframework.com/t/ionic-server-doesnt-shutdown-gracefully-using-cordova/125868>\
**Category:** ionic-v3\
**Created:** [March 25, 2018, 7:53pm UTC](https://forum.ionicframework.com/t/ionic-server-doesnt-shutdown-gracefully-using-cordova/125868 "2018-03-25T19:53:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MacDeveloper5](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@MacDeveloper5](https://forum.ionicframework.com/u/MacDeveloper5)\
**Post date:** [March 25, 2018, 7:53pm UTC](https://forum.ionicframework.com/t/ionic-server-doesnt-shutdown-gracefully-using-cordova/125868/1 "2018-03-25T19:53:40Z")

</div>

I have to build an ionic cordova app. So I prepared my macOS with all needed utilities. First I have to create the app on the browser platform. Therefore I start the process with “ionic cordova run browser”. After testing I just want to shutdown the server with crtl+c, but even a node process will be left. So every time I would have to kill the process using the command line tool “kill”. It isn’t really comfortable.

I found out if I run only the command “cordova run browser” without an ionic build the server is shutting down correctly. The same thing, if I run “ionic serve” without using cordova. Additionally my “ionic info” output:

cli packages: (/usr/local/lib/node\_modules)  
@ionic/cli-utils : 1.19.2  
ionic (Ionic CLI) : 3.20.0

global packages:  
cordova (Cordova CLI) : 8.0.0

local packages:  
@ionic/app-scripts : 3.1.8  
Cordova Platforms : browser 5.0.3  
Ionic Framework : ionic-angular 3.9.2

System:  
ios-deploy : 1.9.1  
Node : v8.10.0  
npm : 5.6.0  
OS : macOS High Sierra  
Xcode : Xcode 9.2 Build version 9C40b

Environment Variables:  
ANDROID\_HOME : not set

Misc:  
backend : legacy

---

<div class="post-metadata">

**Author:** ![aobrien](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@aobrien](https://forum.ionicframework.com/u/aobrien)\
**Post date:** [March 26, 2018, 3:50am UTC](https://forum.ionicframework.com/t/ionic-server-doesnt-shutdown-gracefully-using-cordova/125868/2 "2018-03-26T03:50:45Z")

</div>

I’m having this problem too. When I run `ionic cordova run browser --port 8100` it opens a browser window and displays my app, but it is being accessed on port 8000, not 8100. It seems to ignore the `--port` option. I noticed the following output after the build process:

```auto
Running command: "/path/to/application/platforms/browser/cordova/run" --nobuild

Static file server running @ http://localhost:8000/index.html

```

Furthermore, when I stop the server with Ctrl+C, it seems to still be running on port 8000. I have to stop it manually with `kill`.

Ionic info output:

```auto
cli packages: (/path/to/environment/lib/node_modules)

    @ionic/cli-utils : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 6.4.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms : browser 4.1.0
    Ionic Framework : ionic-angular 3.9.2

System:

    ios-deploy : 1.9.0
    ios-sim : 5.0.8
    Node : v8.10.0
    npm : 5.6.0
    OS : macOS Sierra
    Xcode : Xcode 9.1 Build version 9B55

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

```

**EDIT**  
I found that I could set the port with `ionic cordova run browser -- --port=8100`, but stopping the server with Ctrl+C still does not kill the server. This worked after upgrading the Cordova CLI to 8.0.0.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [March 26, 2018, 1:54pm UTC](https://forum.ionicframework.com/t/ionic-server-doesnt-shutdown-gracefully-using-cordova/125868/3 "2018-03-26T13:54:20Z")

</div>

Ionic CLI issues can be reported here: [https://github.com/ionic-team/ionic-cli/issues](https://github.com/ionic-team/ionic-cli/issues)

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:42pm UTC](https://forum.ionicframework.com/t/ionic-server-doesnt-shutdown-gracefully-using-cordova/125868/4 "2021-07-19T21:42:56Z")

</div>

Closed on July 19, 2021, 9:42pm UTC


