您的位置:首页 > 移动开发

myFirstApp android app

2014-03-29 22:38 471 查看
之前作为业余时间的兴趣,玩过android app。近期学习ros发现rosjava早晚要用到。因此,把android app和java的经验也要攒起来。

重新玩下这个。

adb devices 阶段

ddms配置阶段

在仅有apk情况下,可以使用如下命令行方式adb

1. 安装程序 adb install ebook.apk

2. 重安装程序 adb install -r ebook.apk

3. 卸载程序 adb uninstall net.blogjava.mobile.ebook

只卸载应用程序,保留缓冲和数据 adb uninstall -k net.blogjava.mobile.ebook

4. 指定具体机器

如果机器上有多个模拟器或真机实例,需要使用-s命令行参数指定具体的模拟器或真机。

5.直接运行程序。

A. 在emulator-5554模拟器上运行ebook.apk

adb -s emulator-5554 shell am start -n net.blogjava.mobile.ebook/net.blogjava.mobile.ebook.Main

B. 在真机上运行ebook.apk

adb -s HT9BYL904399 shell am start -n net.blogjava.mobile.ebook/net.blogjava.mobile.ebook.Main

其中Main是ebook.apk的主Activity。(记得输入包名前面是路径,后面还要再输入全称)相当于Windows应用程序的主窗体或Web应用程序的主页面。am是shell命令。

To get started, you’ll need to install OpenJDK or Oracle Java JDK. The OpenJDK version comes with Ubuntu and it’s very easy to install.

To install OpenJDK in Ubuntu, press Ctrl – Alt – T on your keyboard to open the terminal. When it opens, run the commands below to install OpenJDK packages.

sudo apt-get install openjdk-7-jre openjdk-7-jdk icedtea-7-plugin






Next, download Android SDK revision r_21.1 by running the commands below.

wget http://dl.google.com/android/android-sdk_r21.1-linux.tgz[/code] 




Next, run the commands below to extract the downloaded file.

tar -xvzf android-sdk_r21.1-linux.tgz






After extracting the file, change into the tools folder by running the commands below

cd android-sdk-linux/tools/






Next, run the commands below to launch android Android SDK Manager. The manager lets you install libraries and packages suitable for developing Android apps.

./android


When it opens, select all the packages you which to download and install. Make sure all packages are installed then close out.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: