Qvatra
Qvatra

Reputation: 3857

weinre debug tool doesn't work in cordova chrome app(cca) for android

I'm trying to make android app out of chrome packaged app using cordova chrome app(cca). The problem is that weinre client doesn't see my app which running on android tab.

The same chrome app works well with weinre on desktop computer.

As an insertion in html I use:
<script src="http://debug.edgeinspect.adobe.com/target/target-script-min.js#anatomy"></script>

I have
<uses-permission android:name="android.permission.INTERNET" /> in AndroidManifest.xml and <access origin="*" /> in config.xml

The same app builded using vanilla cordova works well with weinre.

How to make weinre work with cca?

Upvotes: 4

Views: 302

Answers (1)

Braden Shepherdson
Braden Shepherdson

Reputation: 134

Weinre works with Cordova apps, as you've seen. There's no reason that I can see why it wouldn't work with a CCA app. There are some extra complications in CCA apps that are not present in vanilla Cordova, however.

First, a sanity check: where did you add the <script> tag? Where you should put it depends on how you created your CCA app:

  • If you used --link-to when creating the CCA app, then you should edit your original Chrome app, since it's been symlinked in.
  • If you used --copy-from, or neither option, then you'll need to make the edit in the www/my_main_page.html file under the CCA project, not in the original Chrome app.

Either way, run cca prepare after making the edit. You can check it really worked by looking in, for example, platforms/android/assets/www/my_main_page.html or platforms/ios/www/my_main_page.html to make sure the <script> tag is there. If the <script> tag really is there but it still doesn't work on the device, comment on my answer and we'll debug further.

Upvotes: 3

Related Questions