How to run ionic app on my mobile device? - ionic-framework

I found one answer "adb devices"commend to know list of devices attached.But my doubt is where to type this commend and how to know my android SDK paths connecting with ionic .please exp in detail

1.) Enable debugging over USB
2.) Install drivers for mobile device
3.) Run adb devices in cmd.exe
$ ionic platform add android
$ ionic run android
Chapter 2: Installation
Windows users developing for Android: You'll want to make sure you
have the following installed and set up.
NOTE: Whenever you make changes to the PATH, or any other environment
variable, you'll need to restart or open a new tab in your shell
program for the PATH change to take effect.
Java JDK
Install the most recent Java JDK (NOT just the JRE).
Next, create an environment variable for JAVA_HOME pointing to the
root folder where the Java JDK was installed. So, if you installed the
JDK into C:\Program Files\Java\jdk7, set JAVA_HOME to be this path.
After that, add the JDK's bin directory to the PATH variable as well.
Following the previous assumption, this should be either
%JAVA_HOME%\bin or the full path C:\Program Files\Java\jdk7\bin
Apache Ant
To install Ant, download a zip from here, extract it, move the first
folder in the zip to a safe place, and update your PATH to include the
bin folder in that folder. For example, if you moved the Ant folder to
c:/, you'd want to add this to your PATH: C:\apache-ant-1.9.2\bin.
Android SDK
Installing the Android SDK is also necessary. The Android SDK provides
you the API libraries and developer tools necessary to build, test,
and debug apps for Android.
Cordova requires the ANDROID_HOME environment variable to be set. This
should point to the [ANDROID_SDK_DIR]\android-sdk directory (for
example c:\android\android-sdk).
Next, update your PATH to include the tools/ and platform-tools/
folder in that folder. So, using ANDROID_HOME, you would add both
%ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools.

Related

Flutter Doctor - Unable to determine bundled Java version

I actually didn't want to install Android Studio to use flutter, so i just installed the Android SDK Command Line Tools.
The thing is, when i run flutter doctor i get the following warning.
And when i create a new project i get this one.
I am able to create and compile flutter projects without any issues, it is only the warning that worries me. Could it cause dependency trouble in the future for java related packages?
Execute these commands one by one and it resolved my issue in MAC .
cd /Applications/Android\ Studio.app/Contents/jre
ln -s ../jre jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
Please ensure Java is in your PATH and that JAVA_HOME is defined and pointing to the JDK. I've had Windows put the JRE in the path instead of the JDK, which leads to all kinds of issues.
Please take a look at your PATH environment variable and remove everything Java related that does not point to the JDK folder.
Oracle has some documentation on how to do this here : Installing Java and setting JAVA_HOME.
I hope I was able to help you.
Just to add, I had 2 versions of Android studio. And I removed one. So there might be a possibility that you have an older/another version of Android Studio present in your machine.

Launch4j - no main manifest attribute

I made a desktop application using netbeans version 6 and after that converted the jar file into exe file using launch4J. But it gives me the error "no main manifest attribute".
Please help me in finding a solution.
And also How I will specify jre version in launch 4j?
Answer to your second question:
You can not specify the JRE version in generated .exe. The version is set in system environment variables of Windows of the machine running the executable.
What you can do is specify the min and max JRE versions which can be used to run your program.
To set min version, navigate to tab 'JRE' in Launch4j and write '1.8.0' to Min JRE version. If you want another version, replace the text with corresponding version.

How to deploy QT5.2 application?

I have QT 5.2 installed on Ubuntu 12.04. I did not build it, but simply downloaded and unzipped from the QT website. My question is how can we package the required libs along with the executable for deployment? The QT documentation says that we should build QT for static linking, but the "configure" file is missing in the QT directory.
Thanks in advance.
Ok. So I finally managed to deploy my Qt app along with its dependencies after countless hours of googling. This was done on Ubuntu 12.04 with Qt 5.2.
This is how I did it:
Statically build Qt from the source using the following command :
./configure -opensource -confirm-license -prefix ./qtbase -make libs -make tools -release -opengl desktop -static -skip qtwebkit -no-icu -nomake tests -nomake examples
make -j -4
You can download the source from http://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.tar.gz
You cannot static build the installer version of Qt.
Open your Qt project and rebuild it. The Qt dependencies will be built into the app executable. Check with ldd to see if it was done correctly.
ldd ./<app_executable>
Now when you try to run this on a system without Qt it might ask for other third party dependencies which you see with ldd. Eg: libxcb-...
You could either install these dependencies with apt-get on the target system or supply the libs with your app. That is: put the required .so files and their soft links into a directory named libs along with your executable.
After the lib dependency problems are fixed the App will give an error about missing Qt fonts. Easiest way to fix this is to supply the Qt fonts folder along with the app.
This link gives a good way of doing this:
http://goblincoding.com/2013/11/07/deploying-qt-5-applications-on-ubuntu-12-04/
The summary of the above page is that you need to supply a small bash script to run your app. the script should be as follows:
#~/bin/bash
export LD_LIBRARY_PATH=./libs
export QT_QPA_FONTDIR=./fonts
./<app_executable>
The target system will now find the libs and the fonts from the directories you supplied and will run without issues. Hope this helped.
NOTE: I haven't tried, but this script method should work even if you are supplying the Qt libs as well without statically building the qt source.

buildozer android debug deploy (run)

I am currently stuck in deploying an app into into my phone.
The app is part of this tutorial. Everything concerning the main.py and buildozer.spec files is set according this tutorial. The app works just fine when run in Eclipse (though some console "errors").
My phone is a Samsung GT-15500, Android version 2.2. and i am also running an apk installer and kivy launcher.
Additionally inside my phone files /mnt/sdcard i cant find a /kivy directory in order to place my app and a simple text file as mentioned here.
Anyway, the thing is that both in the tutorial and the kivy docs the following command: buildozer android debug deploy run fails into my machine. The given error is produced:
# Android packaging done!
# APK Kivyapp1-1.2.0-debug.apk available in the bin directory
# Run '/home/user/.buildozer/android/platform/android-sdk-21/platform-tools/adb devices'
# Cwd None
/home/user/.buildozer/android/platform/android-sdk-21/platform-tools/adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
# Command failed: /home/user/.buildozer/android/platform/android-sdk-21/platform-tools/adb devices
I am suspecting there has something to do with my ADT and SDK tools, configuration etc.
Any suggestions??
Oh and thanks in advance for your time.!
Edit: I am running a Linux Mint 16 distro
Edit2: corrected main.app to main.py and added info about the error.
Everything concerning the main.app
Just to be clear, you mean main.py right?
My phone is a Samsung GT-15500, Android version 2.2. and i am also running an apk installer and kivy launcher.
Have you tried kivy programs in the kivy launcher? Do they work? Phones old enough to use android 2.2 can sometimes have some graphics driver problems or bugs even if they technically meet the kivy requirements.
This wouldn't affect the buildozer compilation though, it's just another thing.
The given error is produced:
Could you set your log_level to 2 in buildozer.spec (the video covers this), run the build again, and paste the full log here. It isn't possible to debug from that single line.
==============
Edit: Okay, it looks like the apk is actually built correctly, and you should be able to find it in the 'bin' subfolder of wherever you ran buildozer. Assuming that's the case, you can try copying it to your phone some other way (email or whatever should work).
The step that's actually failing is the 'deploy' part that should push the apk to your device. I don't know what the error is, and I've never seen buildozer complain about curses before, though I guess you could check that you have curses installed?
My best suggestion is to investigate by navigating to the directory with adb in and playing with it manually. You can look up the commands, like adb install ... to install an apk to your phone - that's what buildozer tries to do.
You should also check that adb is enabled on your phone.

plugman not working on windows? adding core features to phonegap 3.0 app

I have followed theese instructions.
installed plugman (command didnt work, so I added this C:\Users\XXX\AppData\Roaming\npm\node_modules\cordova\node_modules.bin to PATH to make 'plugman' command work in cmd).
after getting plugman command to work (it's help was working in console), Ive entered the camera api command:
plugman --platform android --project c:/path/to/app --plugin https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
the output was:
undefined is not a function
what did I do wrong?
I've found an answer on phonegap google group.
To make this work, you need to install git console and then download the plugin with command:
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
The is a bug that was recently submitted and fixed.
You basically need Git installed, yes, but for plugman to work in "cmd.exe" (or any non-Git CLI) you need to have Git/bin in your system path.
Taken from my blog (http://atomicstructure.net/blog/2013/07/phonegap-3-0-troubles):
Click Start, right-click Computer then select Properties. Click Advanced System Settings (top-left) then Environment Variables in the Advanced tab.
Under System variables find the variable called Path and edit that to include the full system path to where Git is installed. So for example, mine now reads:
%SystemRoot%\system32;%SystemRoot%; [snip] ;C:\Program Files (x86)\Git\bin
With the all important bit highlighted in bold. As with Ant and Android Development Tools, you'll need to include the /bin subfolder, too.