I want to run my sencha app on an android tablet. I wrote "sencha app build" to compile it. And the compilation was successfull. But now how can I run it on my tablet?
Follow below steps :
Run command sencha app build production. It will create production build inside build folder.
You can use either cordova or phonegap,i am using cordova,you can install it by below command.
npm install -g cordova
Create a cordova app in another directory.
cordova create scraper com.test.scraper Scraper
Step 3 will create a directory scraper, Now execute below command in sequence's.
cd scraper
cordova platform add android
Now copy the build\production\scraper\ folder data(from step 1),Ex :-(your_app_name)\build\production\scraper\ to cordova app www folder.
Now run cordova app build android
Step 6 will create apk file inside *platforms\android\ant-build\* folder.Now you can install this apk to your android tablet.
For more Information,you can refer :-
http://www.sencha.com/forum/showthread.php?270566-Building-Sencha-Touch-2-Phonegap-Application-for-Android-Windows/page2
http://cordova.apache.org/docs/en/3.6.0/guide_cli_index.md.html#The%20Command-Line%20Interface
Related
I am trying to convert my existing Angular 8 app to an android app using Cordova.I am following this tutorial.
But, I am getting a white screen when I install the signed and release build in a Android device.Any suggestion?
The following steps work for me
Install cordova globally
Go into the Angular project folder and run this
cordova create mobile
If there is not a folder inside your Angular project
folder called "dist", run this:
ng build
Change directory
cd mobile
Link the dist file with the www file. Run this command in cmd
as administrator
mklink /d "C:\Users\....\www" "C:\Users\....\dist"
Go to the parent directory (you should be in the Angular
project folder now) and run this:
ng build
Go to mobile\www\index.html and do this change
<base href="/"> --> <base href="./">
Go to the mobile directory (cd mobile) and run this
cordova platform add android
Connect the android phone and run this
cordova run android
I have an Ionic app with this folder structure
How can I run this app, knowing that I have node and ionic npm installed in my PC
Type ionic serve to run your app on the browser
Follow steps below:
Open command prompt in windows and goto your app folder using cd command in cmd.
Once you're in, just write ionic serve to see app running in browser.
To run it in device, first build it using ionic platform add android Then ionic build Next ionic run android
It will run application in connected device or emulator.
Make aure you have android setup in your system for this.
You don't have www folder. It's a folder where your html and js and css files are. Without it you don't have an app.
I recommend creating entirely new ionic project with ionic start ProjectName
Then you will be able to run it with ionic serve and see the structure so you can figure out how to run your example
In you have this inside your src folder
css
img
js
lib
index.html
just rename src to www and then run ionic serve.
I created Simple cordova project using visual studio. I want ask
How to convert, save to apk? I tryed to run relise device, didnt
work, the file don't created. Should I use build.phonegap.com? Its
free?
After adding the android platform successfully you can easily use the cli to build the apk with the following command
cordova build android
you can even run the application in an emulator or device connected to your pc via the command
cordova run android
if you prefer to manually copy the apk to your device and then install from there, you can find the apk under " \platforms\android\ant-build "
You can create the apk making a build using the cordova command line. You have to use this command inside your cordova app dir:
cordova build android
And after that look for you apk inside the android platform folder. Of course first you have to add the platform if you have not already done:
cordova platform add android
I hope this helps you!
I am unable to create an android project using cordova in command line. I have followed the following steps and while executing this command "cordova platform add android", I get the following error.
Also, I have downloaded the android SDK files and kept it in a separate folder, and mentioned its path (platform-tools and tools) in the system variables. The Project folder is being created, but could not specify the platform as android. PLEASE HELP !! It would be very helpful if someone explains building an android app using cordova (apart from CORDOVA DOCUMENTATION) easily under few steps. Thanks in advance.
Steps followed:
npm install -g cordova
cordova create hello com.example.hello "HelloWorld"
cd hello
cordova platform add android
Error received:
" Please install Android target "android-19"
Hint-Run "android" from your command line to open the SDK manager "
If you're building an app with Sencha Touch, then you need to use Sencha Cmd to add cordova to your project. First, download from the Sencha website. Then, assuming you've already created your Sencha Touch project, switch to your Sencha Touch project directory and do the following from the command line:
Add a cordova project to your Sencha Touch project
sencha cordova init
Add a platform to your cordova project
cd cordova
cordova platform add android
Change back to the Sencha Touch directory and build and run
cd ..
sencha app build -r native
Follow these steps to create a Sencha Touch 2 app with cordova support for packaging.
Once you have installed Sencha CMD and downloaded the Sencha Touch 2 SDK, run the following:
sencha -sdk [path to sencha sdk] generate app [name of app] [root folder for your app]
sencha cmd will create a folder for you if you have not created one yourself)
From inside the newly created folder, run the following to initiate cordova (you can replace cordova with phonegap and it should work fine):
sencha cordova init
A folder named 'cordova' will be created. From inside this folder, run the following to add android platform:
cordova platform add android
(keep in mind that the latest Android SDK must be downloaded and that you have the 'tools' and 'platform-tools' folders in your path. You can check this by running the command 'android' from the same terminal tab in which you're running sencha commands)
Go back to the root folder of your app, edit the 'cordova.local.properties' file and set the platform to 'android'.
From inside the root folder of your app, run the following to build an aPK:
sencha app build native
For me, the apk file is found under /cordova/platform/android/ant-build/
This APK should install and work fine.
I created an app for android with Sencha Touch 2.3 and Cordova. I used the following command to build and run the apk:
sencha app build -run native
However, this runs the app on the emulator but I would like to directly run it on the usb connected android device. Is it possible?
I already tried commands like these but it didn't work.
sencha app build -device native
or
sencha app build -run -device native
It is possible. There is a difference between Sencha and Cordova commands and both are for different purpose. Once you want to make apk for your android device. Just go through the steps here. But i will advice you to use build of your app to work with in your cordova app.
After making build of your project, Check the following steps:
cordova create yourapp com.example.yourapp YourApp
cd yourapp
cordova platform add android
cordova build android
After this you should copy your project and paste it into the immediate www folder of your cordova project. And then run
cordova run android
NB: sencha app build native
Deploy the .apk file in your emulator or real device to test the app