Skip to content

Vue Devtools ​

Install ​

Since nativescript-vue 3.1, @vue/devtools is an optional peer dependency and must be version 8. It is not bundled with nativescript-vue because it depends on Electron:

bash
npm i -D @vue/devtools@^8

With an older version installed, the build fails with:

@vue/devtools X is installed but nativescript-vue needs ^8. Run: npm i -D @vue/devtools@^8

If --env.vueDevtools is passed without it installed, the build warns --env.vueDevtools was passed but @vue/devtools is not installed.

Run ​

bash
ns run ios|android --env.vueDevtools

The standalone devtools window is launched on the host machine, and the app connects to it when it starts. Start order does not matter — the app reconnects.

Devtools only work in development builds. Apps are named after their root component in the devtools UI.

Options ​

FlagDefaultDescription
--env.vueDevtoolsPort=9000first free port from 8098 upPins the port.
--env.vueDevtoolsHost=http://IPhttp://localhost, http://10.0.2.2 on AndroidSets the host the app connects to. 10.0.2.2 is the Android emulator's alias for the host machine.
--env.vueDevtoolsSpawn=falsetrueSkips launching the devtools app, for when one is already running.
--env.vueDevtoolsDebugoffLogs the socket traffic between the app and the devtools.

Physical devices ​

Pass your machine's LAN IP as the host so the device can reach the devtools:

bash
ns run ios|android --env.vueDevtools --env.vueDevtoolsHost=http://192.168.1.10

The device and the machine must be on the same network.

Android ​

The connection is plain HTTP, so cleartext traffic must be enabled — otherwise connections are silently dropped by the system. In App_Resources/Android/src/main/AndroidManifest.xml, add the following to your existing <application> tag:

diff
<application ...
+  android:usesCleartextTraffic="true"
.../>

Vite ​

The devtools integration is part of the webpack setup (nativescript.webpack.js); there is no Vue Devtools integration for @nativescript/vite yet.

Released under the MIT License.