how to compile and run android application using a batch file and not IDE? -
how can compile , run android application using batch file , not other ide? possible do? , if possible, can teach me how make batch file? don't have idea it, know how run id using eclipse ide. thank you.
from android doc, i'll add debug mode:
debug mode
for immediate application testing , debugging, can build application in debug mode , install on emulator. in debug mode, build tools automatically sign application debug key , optimize package zipalign.
to build in debug mode:
open command-line , navigate root of project directory.
use ant compile project in debug mode: ant debug creates debug .apk file inside project bin/ directory, named -debug.apk. file signed debug key , has been aligned zipalign. each time change source file or resource, must run ant again in order package latest version of application.
to install , run application on emulator, see following section running on emulator.
how run
before can run application on device, must perform basic setup device:
enable usb debugging on device. on devices running android 3.2 or older, can find option under settings > applications > development. on android 4.0 , newer, it's in settings > developer options.
note: on android 4.2 , newer, developer options hidden default.
to make available, go settings > phone , tap build number 7 times. return previous screen find developer options.
ensure development computer can detect device when connected via usb read setting device development more information.
once device set , connected via usb, navigate sdk's platform-tools/ directory , install .apk on device:
adb -d install path/to/your/app.apk
the -d flag specifies want use attached device (in case have emulator running).
a simple batch debug mode be:
set project_root="your_project_root" set adb_location="your adb location" set project_name="your project name" cd %project_root% ant debug cd %adb_location% adb -d install %project_root%/bin/%project_name%-debug.apk
compile in release mode bit more longer, read documentation.
Comments
Post a Comment