Ionic 2 native feature debugging - ionic2

I am writing an app using native functionalities. However, I am finding errors within my app when debugging these features.
How do I debug native features in ionic 2? I could not find good answers.

Emulate your app with ionic run android -l -c.
-l is for livereload and -c is for console logs. Replace android with your system. So you will see all the console logs in your terminal.
I had to change the package.json and replace ionic:serve with ionic:watch

Related

ionic 2 for browser platform is not working

I want to create an app which is able to run in mobile phone and also in browser (of course no device dependency functions). Here are the steps:
ionic start --v2 demo blank
cd demo
ionic platform add browser
ionic build browser
cd platforms/browser
php -S localhost:8000
Then open localhost:8000 in browser.
I looked through the ionicframework document. There is nothing about platform browser. Can anybody advise how I can run my app in browser? Thanks.
You don't need to add the browser platform, just run ionic serve:
ionic start --v2 demo blank
cd demo
ionic serve
Further information can be found here.
From the official documentation ionic2, its clear that the platform can either be ios or android as shown below screenshot.
So, when you want to render it in a browser, you can simply use
ionic serve
If you want to run browser platform, then cd platforms/browser/www instead of cd platforms/browser, and run local server from there.
Perform the following code at the root of the project and then the web-browser based version will be generated at /www/ folder including the sub-directories such as assets, build & index.html which is the main point of entry for the web app.
If you wanna have the app packaged as a staging or production bundle, the following command can be used, which will again generate the prod build at the same /www/location.
npm run ionic:build --prod

How debug wso2 Emm version 2 java souce code?

I want to do some cutomization to the wso2 mdm-product source code (EMM version 2) : https://github.com/wso2/product-mdm
Indeed, when i made some modification to the source code, i need at least 15 min to build the maven projet with eclipce IDE.
Is there other solution to build project directly on carbon server?
How can we debug project with eclipse IDE on carbon IDE?
Usually, it takes some amount of time to build the WSO2 product-mdm, in your case, 15 minutes looks perfectly normal. I'd recommend building the source code using the terminal as follows.
Navigate to the repository directory
cd [path-to-dir]/product-mdm
Perform a clean Maven Build
mvn clean install
If you're unclear about the building process of WSO2 EMM Repositories, the answer on below question might help you to understand the building order.
How to use and understand wso2 git repositories?
Debugging
Remote debugging the project is easy.
Setup the Eclipse IDE for remote debugging as described in this link,
Debugging With Eclipse
Navigate to "[EMM_HOME]/bin/" folder and run the server in debug mode.
sh ./wso2server.sh -debug [specify-port-here]
eg: sh ./wso2server.sh -debug 5005
Once the server is up, you can start debugging.

How to do remote debugging with Browser-sync?

I have installed browser sync with npm. On their website, they have mentioned that it also allows remote debugging. But they have not mentioned that how to do remote debugging.
I have used below command to run mysite on browser-sync.
browser-sync start --proxy localhost:8080/mysite
how can I remote debug that?
Though this was quite a tricky process in versions before Browser-sync 2.0, but with Browser-sync 2.0 you now have a brand new Web UI, which makes this process a whole lot easier.
Firstly you need to update Browser-sync to it's latest version
npm install -g browser-sync#latest
Then run any command like you would.
eg:
browser-sync start --proxy "myproject.dev" --files "css/*.css"
To open this Web UI open
http://localhost:3001
Below are links to articles that talk about Remote Debuggging in Browser-Sync:
http://www.wearejh.com/news/browsersync-2-0/
http://www.sitepoint.com/improve-workflow-browsersync-2-0/

sencha app build native without minify JS

I want be able to build a native app, but without minifying the JS so I can debug it later confortably.
Currently I'm executing:
sencha app build native
How can I be able to build without minifying JS files?
Thanks
For native build, you can only have testing option after upgrade to Sencha CMD 5.x, refer to
http://docs.sencha.com/cmd/5.x/cmd_upgrade_guide.html
Under Cordova / PhoneGap
"These build profiles ensure that all of the “sencha app build” command variations are equivalent to previous releases. You will notice, however, that “native” is now a build profile instead of an environment (like “testing” or “production”). This means you can now do “sencha app build native testing” which was previously not possible."
So, the command should be
sencha app build native testing
You need to use this command line instead:
sencha app build testing
That way, all JavaScript source files are bundled but not minified; and you could debug easily.
See Sencha CMD 4 documentation for more details.

Google chrome, native client support and development

I would like to write a small C++ app and run it on chrome using the native client API.
I have a few questions though:
1) I compiled the examples on Ubuntu and ran the code on firefox but can't run it on chrome (using version 5.0.342.7 beta)
Do I need to install something? An extension/plugin?
2) I can't find a single online application I could run? Links anyone, I want to see the power of this thing without having to compile the code locally.
Thanks for your help,
-hbt
PS:
I don't know what's the policy with asking multiple questions. If it's a problem, let me know and I will create multiple threads.
More details:
Already read doc at
http://code.google.com/p/nativeclient/wiki/NativeClientInGoogleChrome
Running with --enable-nac from the command line and I have this error
.mozilla/plugins/sel_ldr_bin.trace: cannot dynamically load executable
I already built and installed sel_ldr
./scons -c --mode=opt-linux sel_ldr
./scons -c --mode=nacl
./scons run_all_tests
./scons --mode=opt-linux npGoogleNaClPlugin
./scons --verbose firefox_install
Works in firefox! not in chrome
Double checked about:plugins in chrome
Native Client Plugin is enabled and pointing to
.mozilla/plugins/libnpGoogleNaClPlugin.so
Please advise
Thanks
Did you launch Chromium with the following parameter --enable-nac.
1) Firefox is not supported now(maybe in the future it will be supported again). It seems that you are not using the latest SDK.
2) You need to use newer Chrome browser(yes Chrome is running nativeclient module now as well). In Ubuntu, you may use the google repository for testing
deb http://dl.google.com/linux/deb/ stable non-free main
deb http://dl.google.com/linux/deb/ testing non-free main
and the package of the chrome in dev channel is named 'google-chrome-unstable'. For more information of google linux repository, refer to: www.google.com/linuxrepositories/
3) Native Client's SDK is separated into nativeclient-sdk. It's easy to use. Here is the guide: http://code.google.com/p/nativeclient-sdk/wiki/HowTo_GetStarted
Have Fun!