Ionic serve --lab features

Using the ionic serve --lab tool is sooooo helpful for developing ionic apps.

However, is there any plans to build in native device features at all?

One thing particular is being able to test the app on online and offline conditions and still debug the code, which is somewhat difficult on a PC! I have used the Ripple emulator in Chrome for this so far but it doesn’t always work too well.

Thanks!

You can already do it, Open Chrome dev tools click on the mobile icon and select your connection and device

Regards

I’ve tried using that but it then stops everything working. (like page navigation etc)

It seems the chrome dev tools affects the browser’s network connection as opposed to emulating a device’s network connection

I works for me,
try to click either on Android or IOS in the lab view and change the network speed

Ah okay, I’ll have another go!

You do this in the dev tools at the same time as running the app in lab?

This doesn’t work for me I’m afraid!

The network speed does work yes, because it is changing the speed in the entire browser. When set to offline it doesn’t work at all.

If I set it to offline then F5 to refresh…

image

The big goal of the lab feature is to provide just a visual example of what your app will look like on ios and android while working in the browser.

Mocking device api’s isn’t really goal

Ah right okay! Thanks for replying @mhartington

Shouldn’t functionality of apps be considered just as important, if not more important, than the styling though?

Oh definitely, but the best way to test out device specific functionality is to actually load the app on a device.

I understand that, it’s just hard to debug when it’s actually running on the app.

Most of the javascript is fine to debug in chrome when developing but the device features like online/offline etc aren’t so easy. Like I said, Ripple is okay but doesn’t always work as expected!

I’ve implemented an error logging service with stacktrace.js and hoping that will help if there are any bugs :slight_smile:

(Lab is awesome already by the way, it’s made it so much easier to test the styling and general app use. Just wondered if any other features were in the making!)

Any plans to include iPhone and iPad side-by-side? I’m only working on iOS at the moment, and this would prevent me from having multiple Chrome windows open to simultaneously emulate iPhone and iPad.

2 Likes

Hello,
I really like the ionic serve --labs
In my last app, i cannot use it because device ready event was never sent.

beginning of my app.js :

angular.module('assetList', ['ionic', 'firebase', 'assetList.controllers']) .run(function($ionicPlatform, $rootScope, $firebaseAuth, $firebase, $window, $ionicLoading) { $ionicPlatform.ready(function() { //never happen :( }

you can see the www folder on https://github.com/hemgui/TestIonic

I think it’s a bug because it works fine with ionic serve or on devices

Guillaume

I had this problem as well.

When using cordova serve, some popups usually come up. When we cancel the dialog boxes, the deviceready event will not fire.