Frank
Frank

Reputation: 2173

Run Cordova app using Chrome Device Mode Mobile Emulation

I have always used ripple to run my cordova app in desktop browsers. But I know that there is a better tool to emulate mobile apps and it's integrated in chrome: Chrome Device Mode Mobile Emulation.

Is there a way to use Chrome Device Mode Mobile Emulation instead of using ripple to emulate my app in chrome?

Thanks

Upvotes: 3

Views: 1721

Answers (2)

jonmc12
jonmc12

Reputation: 560

I'm able to use Chrome Device Emulation with my Cordova app, however in the 'emulation' tab, under 'device' I had to uncheck 'emulate mobile' for the app to render like it would on a mobile device.

Upvotes: 0

Prabhu Vignesh Rajagopal
Prabhu Vignesh Rajagopal

Reputation: 1078

Chrome remote debugging is easy and useful to monitor or debug network related bug in mobile application. Just follow the following steps.

Before that you have to add these lines in your application's src file (.java)

 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    if (0 != (getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE))
    { WebView.setWebContentsDebuggingEnabled(true); }
  }

(This will allow chrome to monitor running webview)

  1. Enable USB debugging in your mobile
  2. Connect your device with PC.
  3. Open chrome in your PC
  4. Go to Chrome menu > More tools > Inspect Devices.
  5. Check in Discover USB devices check box
  6. Find Your application in list
  7. You can screencast your app to chrome now.

That is it!! You can debug your application from chrome.

Note:- Its only for android

Upvotes: 0

Related Questions