Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova run browser not working Ubuntu 14.04

I have installed Cordova and built a basic app. The application is running fine in my android device. To make work easier, I was trying to run the Cordova browser platform. I ran the following commands in my project directory:

cordova platforms add browser
cordova run browser

The second command gives the following output:

Running command: /home/nitin/cordova_project/random_play/platforms/browser/cordova/run

but doesn't start any browser. I am using Ubuntu 14.04, and have google chrome installed. I, also killed all the running instances of chrome by running

pkill chrome

before running the cordova command. Could someone please tell me how I can fix this problem. Thank you.

like image 272
skadoosh Avatar asked Apr 19 '15 13:04

skadoosh


1 Answers

  1. Install google-chrome on ubuntu/linux
  2. edit /platforms/browser/cordova/run
  3. add additional case statement for linux before ending "}"
  4. test with cordova run browser

Code:

case 'linux':
    spawn('google-chrome', ['--test-type', '--disable-web-security', '--user-data-dir=/tmp/temp_chrome_user_data_dir_for_cordova_browser', project]);
    break;
like image 103
Pieter Avatar answered Nov 06 '22 09:11

Pieter