Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
565 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 Reply

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...