ubutu14.04 android开发环境安装文档

					ubutu14.04 android开发环境安装文档

首先安装interl 网卡驱动。
解压e1000e-3.3.5.3.tar.gz,解压后通过终端窗口进入src文件夹,输入sudo make install
然后输入sudo modprobe e1000e

然后跟新驱动
在ubuntu 右上脚有一个太阳一样的图标,点击进入系统设置,然后在hardware里面右一个附加驱动

安装anriod 编译环境
1.
apt-get update 更新源

2、sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev
lib32z1 lib32ncurses5 lib32bz2-1.0 x11proto-core-dev lib32z1-dev libgl1-mesa-dev g+±multilib mingw32 tofrodos
python-markdown libxml2-utils lib32readline-gplv2-dev

3.apt-get -y install openjdk-7-jdk

4.安装完编译报错
1、/bin/bash: prebuilts/misc/linux-x86/bison/bison: No such file or directory
当出现该问题时,通过阅读,并不是没有bison这个运行库,而是没有找到该库;
执行下面命令即可。
sudo apt-get install g+±multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

sudo apt-get install bison
sudo apt-get install flex

/bin/bash: xmllint: command not found
方法:sudo apt-get install libxml2-utils

sudo apt-get install curl

/bin/bash: gperf: command not found
sudo apt-get install gperf

5.ubuntu 设置共享文件夹
1.安装samba服务,在终端中输入:sudo apt-get install samba samba-common进行安装

cd /home/
mkdir -p project
chomd -R 777 project
选择文件夹project,单击右键选择sharing options

‘net usershare’ returned error 255: net usershare add: cannot share path /home/project as we are restricted to only sharing directories we own.
Ask the administrator to add the line “usershare owner only = false”
to the [global] section of the smb.conf to allow this.

解决:
sudo gedit /etc/samba/smb.conf

在配置文件中找到usershare allow guests = yes,在后面一行添加 usershare owner only = false

在其中添加一行: security = user ,添加这一行的目的在于,只有输入账号和密码才能访问此文件夹。添加的位置如下:

#### Debugging/Accounting ####  
  
# This tells Samba to use a separate log file for each machine  
# that connects  
   log file = /var/log/samba/log.%m  
  
# Cap the size of the individual log files (in KiB).  
   max log size = 1000  
   security = user  
# If you want Samba to only log through syslog then set the following  
# parameter to 'yes'.  
#   syslog only = no  
  
# We want Samba to log a minimum amount of information to syslog. Everything  
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log  
# through syslog you should set the following parameter to something higher.  
   syslog = 0  
  
# Do something sensible when Samba crashes: mail the admin a backtrace  
   panic action = /usr/share/samba/panic-action %d  

然后在文件最后增加
[share]
comment=this is Linux share directory
path=/home/project
public=yes
writeable=yes
browseable = yes

4.samba配置完成之后,就要为samba建了用户了,在终端中执行:sudo useradd smbuser(在此,smbuser尽量建立为你现在的用户名,不然的话对你现在用户的所有的文件只有读的权限。)

5.为你建立的smb用户设立密码,在终端中执行:sudo smbpasswd -a smbuser,之后输入密码确认。 然后重启smb服务,在终端中执行指令:
$ sudo service smbd restart

重启smbd
sudo /etc/init.d/smbd restart

如何在ubuntu12.04左栏增加终端窗口?
在左栏的第一个dash菜单输入terminal,然后将termianl拖到左侧就可以了

6.ubuntu 12.04 静态ip地址
sudo gedit /etc/network/interfaces
原来有
auto lo
iface lo inet loopback
然后在后面增加
auto eth0
iface eth0 inet static
address 192.168.1.105 //要设置的ip地址
netmask 255.255.255.0
gateway 192.168.1.1

这样配置完后如果不配dns,会发现上不了网
手动配置dns
sudo gedit /etc/resolv.conf
nameserver 192.168.1.105
nameserver 8.8.8.8

这样发现重启后有改回去了默认值去了,永久修改的方法:
sudo gedit /etc/resolvconf/resolv.conf.d/base
增加
nameserver 192.168.1.105
nameserver 8.8.8.8

最后
sudo /etc/init.d/networking restart

git ssh key 生成部骤
1.sudo apt-get install git git-core
2.设置git 的用户名和密码
git config --global user.name “zxw”
git config --global user.email "zxw@ydtek.com"
3.ssh key 密钥生成过程
1.查看是否已经有了ssh密钥: cd ~/.ssh
如果没有密钥则不会有此文件夹,有则删掉重新生成
2.ssh-keygen -t rsa -C "zxw@ydtek.com" 按一个回车,然后输入密码,在输入一次密码
最后在.ssh文件夹里面会生成 id_rsa 和 id_rsa.pub

安装adb
1、
sudo add-apt-repository ppa:phablet-team/tools
sudo apt-get update
sudo apt-get install android-tools-adb

将android设备连接至电脑,执行adb shell会提示“error: device not found”

2、将android设备连接至电脑,通过lsusb查看usb设备,如下红色部分对应的就是android设备
zxw@zxw:/$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 8087:800a Intel Corp.
Bus 002 Device 002: ID 8087:8002 Intel Corp.
Bus 001 Device 007: ID 0e8d:201d MediaTek Inc.
Bus 002 Device 003: ID 046d:c077 Logitech, Inc.
Bus 002 Device 004: ID 046d:c31c Logitech, Inc. Keyboard K120 for Business

3、创建adb_usb.ini文件,写入id
echo 0x0e8d > ~/.android/adb_usb.ini

4、vid,pid
sudo gedit /etc/udev/rules.d/70-android.rules
加入以下内容,注意红色部分对应的就是lsusb得到的id
SUBSYSTEM==“usb”, ATTRS{idVendor}“0e8d”, ATTRS{idProduct}“201d”,MODE=“0666”

5、修改权限
$sudo chmod a+rx /etc/udev/rules.d/70-android.rules
$sudo service udev restart

  1. 重启adb服务,adb devices有设备说明adb安装成功
    $adb kill-server
    $sudo adb start-server
    $adb devices
    List of devices attached

windows 通过putty , ssh ,securecrt去编译ubuntu的代码时必须在ubuntu的电脑安装sudo apt-get install ssh

mtk6589 编译报错
Please check your building environment First!

[OS]: Ubuntu 12.04.5 (64-bit) [WARNING]
[perl]: 5.14.2 (64-bit) [WARNING]
[python]: 2.7.3 (64-bit) [WARNING]
[gcc]: 4.6.3 (64-bit) [WARNING]
[jdk]: 1.7.0_121 (64-bit) [WARNING]
[bison]: 2.5 (64-bit) [WARNING]
[mingw]: [FAIL]
[unix2dos/tofrodos]: [FAIL]

sudo apt-get install mingw32 tofrodos

6589 4.4 java 使用jdk1.6.0_32
将jdk-6u32-linux-x64.bin拷贝到/usr/lib/jvm/下面
sudo chmod 777 jdk-6u32-linux-x64.bin
sudo ./jdk-6u32-linux-x64.bin

sw12@sw12:/home/yd/mt6589_4.4/alps$ ./makeMtk eastaeon89_wet_kk n

checking Env**
Please check your building environment First!

[OS]: Ubuntu 12.04.5 (64-bit) [WARNING]
[perl]: 5.14.2 (64-bit) [WARNING]
[python]: 2.7.3 (64-bit) [WARNING]
[gcc]: unknown (64-bit) [FAIL]
[bison]: 2.5 (64-bit) [WARNING]

The detail information is in “checkenv.log”!


Mtk在检测gcc的时候会存在不兼容的情况,导致无法检测到gcc,出现gcc unkown错误。gcc nv检测的时候 做了以下操作(具体代码位置参见:mediatek/build/tools/checkEnv.py 函数GccCheck。):
首先在脚本中执行了gcc --v 命令,然后在返回的信息中通过匹配”.gcc\sversion\s*”格式查找gcc的版本。由于我们当前的版本是4.6.1 不支持gcc --v, 仅支持gcc -v,而中文语言环境下返回的版本信息中”version”用了中文字符”版本”,会导致匹配不成功。因此需要做以下修改:

1.降低gcc版本
ubuntu 11.10的gcc版本是4.6.1,把gcc版本改为4.4.3。
ubuntu 32bit系统下安装gcc 4.4:

sudo apt-get install gcc-4.4
sudo apt-get install g+±4.4

装完后在/usr/bin目录下
$ ls -l gcc*
lrwxrwxrwx 1 root root 7 2011-10-29 09:11 gcc -> gcc-4.6
-rwxr-xr-x 1 root root 224544 2011-10-06 05:47 gcc-4.4
-rwxr-xr-x 1 root root 302104 2011-09-17 05:43 gcc-4.6

发现gcc 链接到gcc-4.6, 需要将它改为链接到gcc-4.4 :

sudo mv gcc gcc.bak
sudo ln -s gcc-4.4 gcc

同理
ls -l g++*
lrwxrwxrwx 1 root root 7 2011-08-14 15:17 g++ -> g+±4.6
-rwxr-xr-x 1 root root 228640 2011-10-06 05:45 g+±4.4
-rwxr-xr-x 1 root root 306200 2011-09-17 05:39 g+±4.6
需要将g++链接改为g+±4.4:
/usr/bin$ sudo mv g++ g++.bak
/usr/bin$sudo ln -s g+±4.4 g++

再查看gcc和g++版本号:
gcc -v
g++ -v
均显示gcc version 4.4.6 ,说明gcc 4.4安装成功。

局域网内ubuntu 系统之间的访问
把需要访问的服务器地址输入,例如 smb://192.168.1.14

openjdk 8安装
sudo -E add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk

andriod 7.0 编译报错
FAILED: /bin/bash -c “(prebuilts/sdk/tools/jack-admin install-server prebuilts/sdk/tools/jack-launcher.jar prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar 2>&1 || (exit 0) ) && (JACK_SERVER_VM_ARGUMENTS=”-Dfile.encoding=UTF-8 -XX:+TieredCompilation" prebuilts/sdk/tools/jack-admin start-server 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update server prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar 4.8.ALPHA 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-2.28.RELEASE.jar 2.28.RELEASE || exit 47; prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-3.36.CANDIDATE.jar 3.36.CANDIDATE || exit 47; prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-4.7.BETA.jar 4.7.BETA || exit 47 )"
/bin/bash: prebuilts/sdk/tools/jack-admin: Permission denied
/bin/bash: prebuilts/sdk/tools/jack-admin: Permission denied
/bin/bash: prebuilts/sdk/tools/jack-admin: Permission denied
/bin/bash: prebuilts/sdk/tools/jack-admin: Permission denied

make: *** No rule to make target vendor/mediatek/proprietary/operator/OP02/prebuilt/bootanim/bootanimation/LTE/bootanimation.zip', needed byout/target/product/aeon6735_65u_v_l1/obj/media/bootanimation.zip_intermediates/bootanimation.zip’. Stop.
35平台原始快关机动画位于vendor/mediatek/proprietary/operator/OP02/prebuilt/bootanim/bootanimation

bcompare install
chmod 777 BCompare-zh-3.3.4.14431.exe
chown zxw BCompare-zh-3.3.4.14431.exe
chgrp zxw BCompare-zh-3.3.4.14431.exe
// bu ran an zhuang bu le

bcompare shezhi zhiti daxiao
gong ju -> xuan xiang li mian you wenjian jia shetu he wenjian shi tu ,ran hou xuanze xianshi jiu keyi shezhi

ubuntu环境下执行adb shell 时报错 error: device not found.
解决方法:
1.使用lsusb 查看usb设备,如下红色部分对应的就是android设备

Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 0461:4e04 Primax Electronics, Ltd
Bus 003 Device 011: ID 2717:9039
Bus 003 Device 003: ID 17ef:6019 Lenovo
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

若不知道哪个是你的设备,可以拔掉后lsusb,然后对比即可.

2.创建adb_usb.ini文件,写入id

在home下寻找.android目录,在此目录下新建一个文件adb_usb.ini

echo 0x2717> ~/.android/adb_usb.ini

3.添加权限

sudo vim /etc/udev/rules.d/android.rules

加入以下内容,注意红色部分对应的就是lsusb得到的id

SUBSYSTEM==“usb”, ATTRS{idVendor}“2717”, ATTRS{idProduct}“9039”,MODE=“0666”

4.重启USB服务

$sudo chmod a+rx /etc/udev/rules.d/android.rules
$sudo service udev restart

5.重启adb服务,adb devices有设备说明adb安装成功

$adb kill-server

$sudo adb start-server

$adb devices

List of devices attached
5cb00b6 device

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值