Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
561 views
in Technique[技术] by (71.8m points)

android - Sencha Touch 2.3 / Cordova : Build run directly on device

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...