Hybrid View
-
14 Oct 2012 11:30 AM #1
Debug an app with weinre
Debug an app with weinre
Finally,
it's almost there !
I used weinre to debug my app on my android phone : no pb with the web app
But if I packqge build with sencha cmd, app is not launching, weinre is not seeing the target.
I see that the script src with the weinre is still there in my apk, in index.html !
(Uh ? why is there an index.html in my apk, with development.js in it ? It should be production.js or something like that, right ?)
-
16 Oct 2012 6:47 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
Are you using an IP to the weinre server and the server is listening on that IP?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
16 Oct 2012 5:39 PM #3
Yep ! It works with the app on localhost running on the emulator
I see the weinre client on my weinre server
It's not working with the app builded
EDIt; I'll be more specific, same happends with emulator or my smartphone : I can see my app when launching chrome on android : I can see the client connected on weinre. I can't see my app when launched as an apk : just the 3 dots blinking ; I can't see it in weinre.
-
24 Oct 2012 4:22 PM #4
Sorry to ask again, but did someone succeed in debugging an apk (packed with sencha CMD) with weinre ?
I switch back to the test app "Welcome to sencha touch 2", even with this code, I see my client when launching the app via emulator's browser, not when launching the app in apk (which is hanging on the white dots)
Here the only thing I add to the code in index.html : the line 52 (and again, why is there development.js in my apk ? why is is not production.js ? or something else ?)
EDIT :Code:@-webkit-keyframes appLoadingIndicator{ 0% { opacity: 0.8 } 50% { opacity: 0 } 100% { opacity: 0.8 } } </style> <script src="http://192.168.0.10:8080/target/target-script-min.js#anonymous"></script> <!-- The line below must be kept intact for Sencha Command to build your application --> <script id="microloader" type="text/javascript" src="touch/microloader/development.js"></script> </head>
The only thing shown in the console when using chrome on my smartphone is this :
When packed, the app wont launch, weinre shows nothingCode:[INFO] [Ext.ClassManager] Overriding existing alias: 'widget.component' of: 'Ext.dataview.DataView' with: 'Ext.Component'. Be sure it's intentional. [INFO] [Ext.ClassManager] Overriding existing alias: 'widget.mask' of: 'Ext.LoadMask' with: 'Ext.Mask'. Be sure it's intentional. [INFO] [Ext.ClassManager] Overriding existing alias: 'widget.container' of: 'Ext.dataview.DataView' with: 'Ext.Container'. Be sure it's intentional. [INFO] [Ext.ClassManager] Overriding existing alias: 'widget.viewport' of: 'Ext.viewport.Android' with: 'Ext.viewport.Default'. Be sure it's intentional. [INFO] [Ext.ClassManager] Overriding existing alias: 'widget.component' of: 'Ext.dataview.DataView' with: 'Ext.Component'. Be sure it's intentional. [INFO] [Ext.ClassManager] Overriding existing alias: 'widget.mask' of: 'Ext.LoadMask' with: 'Ext.Mask'. Be sure it's intentional. [INFO] [Ext.ClassManager] Overriding existing alias: 'widget.container' of: 'Ext.dataview.DataView' with: 'Ext.Container'. Be sure it's intentional. [INFO] [Ext.ClassManager] Overriding existing alias: 'widget.viewport' of: 'Ext.viewport.Android' with: 'Ext.viewport.Default'. Be sure it's intentional.
-
29 Oct 2012 7:04 AM #5
Try to add the script inside the app.json.
What I've been doing inside my app is adding a way to turn on/off the remote debugging. Example I have a togglefield in my configuration screen and I am listening the dragend event of that field and in my controller I load the script at runtime.
I don't have any problem with that for now.Code:var bodyEl = document.getElementsByTagName('body')[0], scriptDebugJS; // create script element scriptDebugJS = document.createElement('script'); scriptDebugJS.type = "text/javascript"; scriptDebugJS.src = "http://ip_address_of_server:3000/target/target-script-min.js#anonymous"; scriptDebugJS.id = "scriptDebugJS"; bodyEl.appendChild(scriptDebugJS);
I'm still looking a way to turn off the debugger. Removing the script at runtime does not stop the connection to the weinre server.
-
17 Nov 2012 10:43 PM #6
Could you tell me how do I add an easy line for weinre in app.json please ?
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote