1,vpn之增加L2TP方式
ubuntu自带pptp,然后给他安个支持l2tp
然后这时候配置VPN的时候就有L2TP选项了
- ①添加软件源
- senrsl@senrsl-T540p:~$ sudo apt-add-repository ppa:seriy-pr/network-manager-l2tp
- [sudo] password for senrsl:
- Packages for https://github.com/seriyps/NetworkManager-l2tp
- Screenshot: http://dl.seriyps.ru/img/network-manager-l2tp.png
- Full description (in russian) http://seriyps.ru/blog/2012/01/31/plagin-l2tp-dlya-networkmanager/
- Installation:
- sudo apt-add-repository ppa:seriy-pr/network-manager-l2tp
- sudo apt-get update
- sudo apt-get install network-manager-l2tp-gnome
- !!!!!!!!!!!!!!!!!!
- sudo service xl2tpd stop
- sudo update-rc.d xl2tpd disable
- !!!!!!!!!!!!!!!!!!
- 更多信息: https://launchpad.net/~seriy-pr/+archive/ubuntu/network-manager-l2tp
- 按回车继续或者 Ctrl+c 取消添加
- gpg: 钥匙环'/tmp/tmpzpodxcos/secring.gpg'已建立
- gpg: 钥匙环'/tmp/tmpzpodxcos/pubring.gpg'已建立
- gpg: 下载密钥'B11E44D2',从 hkp 服务器 keyserver.ubuntu.com
- gpg: /tmp/tmpzpodxcos/trustdb.gpg:建立了信任度数据库
- gpg: 密钥 B11E44D2:公钥"Launchpad PPA for Sergey Prochorov"已导入
- gpg: 合计被处理的数量:1
- gpg: 已导入:1 (RSA: 1)
- OK
- ②更新缓存
- senrsl@senrsl-T540p:~$ sudo apt-get update
- 忽略 http://archive.ubuntu.com trusty InRelease
- 忽略 http://ppa.launchpad.net trusty InRelease
- 命中 http://archive.ubuntu.com trusty Release.gpg
- 获取:1 http://ppa.launchpad.net trusty Release.gpg [316 B]
- 命中 http://archive.ubuntu.com trusty Release
- 获取:2 http://ppa.launchpad.net trusty Release [14.0 kB]
- 命中 http://archive.ubuntu.com trusty/universe Sources
- 获取:3 http://ppa.launchpad.net trusty/main amd64 Packages [1,097 B]
- 命中 http://archive.ubuntu.com trusty/main Sources
- 获取:4 http://ppa.launchpad.net trusty/main i386 Packages [1,093 B]
- 命中 http://archive.ubuntu.com trusty/multiverse Sources
- 命中 http://archive.ubuntu.com trusty/restricted Sources
- 命中 http://archive.ubuntu.com trusty/main amd64 Packages
- 命中 http://archive.ubuntu.com trusty/universe amd64 Packages
- 命中 http://archive.ubuntu.com trusty/restricted amd64 Packages
- 命中 http://archive.ubuntu.com trusty/multiverse amd64 Packages
- 命中 http://archive.ubuntu.com trusty/main i386 Packages
- 命中 http://archive.ubuntu.com trusty/universe i386 Packages
- 命中 http://archive.ubuntu.com trusty/restricted i386 Packages
- 命中 http://archive.ubuntu.com trusty/multiverse i386 Packages
- 命中 http://archive.ubuntu.com trusty/main Translation-zh_CN
- 命中 http://archive.ubuntu.com trusty/main Translation-en
- 命中 http://archive.ubuntu.com trusty/multiverse Translation-zh_CN
- 忽略 http://ppa.launchpad.net trusty/main Translation-zh_CN
- 忽略 http://ppa.launchpad.net trusty/main Translation-zh
- 忽略 http://ppa.launchpad.net trusty/main Translation-en
- 命中 http://archive.ubuntu.com trusty/multiverse Translation-en
- 命中 http://archive.ubuntu.com trusty/restricted Translation-zh_CN
- 命中 http://archive.ubuntu.com trusty/restricted Translation-en
- 命中 http://archive.ubuntu.com trusty/universe Translation-zh_CN
- 命中 http://archive.ubuntu.com trusty/universe Translation-en
- 忽略 http://archive.ubuntu.com trusty/main Translation-zh
- 忽略 http://archive.ubuntu.com trusty/multiverse Translation-zh
- 忽略 http://archive.ubuntu.com trusty/restricted Translation-zh
- 忽略 http://archive.ubuntu.com trusty/universe Translation-zh
- 下载 16.6 kB,耗时 18秒 (895 B/s)
- 正在读取软件包列表... 完成
- ③安装
- senrsl@senrsl-T540p:~$ sudo apt-get install network-manager-l2tp
- 正在读取软件包列表... 完成
- 正在分析软件包的依赖关系树
- 正在读取状态信息... 完成
- 将会安装下列额外的软件包:
- network-manager-l2tp-gnome openswan xl2tpd
- 建议安装的软件包:
- openswan-modules-source openswan-modules-dkms openswan-doc
- 下列【新】软件包将被安装:
- network-manager-l2tp network-manager-l2tp-gnome openswan xl2tpd
- 升级了 0 个软件包,新安装了 4 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
- 需要下载 76.9 kB/1,353 kB 的软件包。
- 解压缩后会消耗掉 4,141 kB 的额外空间。
- 您希望继续执行吗? [Y/n] Y
- 获取:1 http://ppa.launchpad.net/seriy-pr/network-manager-l2tp/ubuntu/ trusty/main network-manager-l2tp amd64 0.9.8.5-0trusty1 [20.1 kB]
- 获取:2 http://ppa.launchpad.net/seriy-pr/network-manager-l2tp/ubuntu/ trusty/main network-manager-l2tp-gnome amd64 0.9.8.5-0trusty1 [56.8 kB]
- 下载 76.9 kB,耗时 2秒 (33.6 kB/s)
- 正在预设定软件包 ...
- 正在选中未选择的软件包 openswan。
- (正在读取数据库 ... 系统当前共安装有 202845 个文件和目录。)
- 正准备解包 .../openswan_1%3a2.6.38-1_amd64.deb ...
- 正在解包 openswan (1:2.6.38-1) ...
- 正在选中未选择的软件包 xl2tpd。
- 正准备解包 .../xl2tpd_1.3.6+dfsg-1_amd64.deb ...
- 正在解包 xl2tpd (1.3.6+dfsg-1) ...
- 正在选中未选择的软件包 network-manager-l2tp。
- 正准备解包 .../network-manager-l2tp_0.9.8.5-0trusty1_amd64.deb ...
- 正在解包 network-manager-l2tp (0.9.8.5-0trusty1) ...
- 正在选中未选择的软件包 network-manager-l2tp-gnome。
- 正准备解包 .../network-manager-l2tp-gnome_0.9.8.5-0trusty1_amd64.deb ...
- 正在解包 network-manager-l2tp-gnome (0.9.8.5-0trusty1) ...
- 正在处理用于 man-db (2.6.7.1-1ubuntu1) 的触发器 ...
- 正在处理用于 ureadahead (0.100.0-16) 的触发器 ...
- 正在设置 openswan (1:2.6.38-1) ...
- ipsec_setup: Stopping Openswan IPsec...
- ipsec_setup: stop ordered, but IPsec appears to be already stopped!
- ipsec_setup: doing cleanup anyway...
- ipsec_setup: Starting Openswan IPsec U2.6.38/K3.19.0-28-generic...
- 正在设置 xl2tpd (1.3.6+dfsg-1) ...
- Starting xl2tpd: xl2tpd.
- 正在设置 network-manager-l2tp (0.9.8.5-0trusty1) ...
- 正在设置 network-manager-l2tp-gnome (0.9.8.5-0trusty1) ...
- ④停止并禁用xl2tpd
- senrsl@senrsl-T540p:~$ sudo service xl2tpd stop sudo update-rc.d xl2tpd disable
- Stopping xl2tpd: xl2tpd.
- senrsl@senrsl-T540p:~$
2,编译安装ubuntu14.04x64版SoftEtherVPN试试
①fork下载https://github.com/senRsl/SoftEtherVPN
②流程
- $ cd SoftEtherVPN
- $ ./configure
- $ make
- $ make install
③make的时候会报错,各种找不到
说明依赖环境没配好
需要的依赖
- You need to install the following software to build SoftEther VPN for UNIX.
- - Linux, FreeBSD, Solaris or Mac OS X.
- - GNU Compiler Collectipon (gcc) and binary utilities.
- - GNU Make (gmake).
- - GNU C Library (glibc).
- - POSIX Threads (pthread).
- - OpenSSL (crypto, ssl).
- - libiconv.
- - readline.
- - ncurses.
- sudo apt-get install libreadline-dev
- sudo aptitude install libssl-dev
- sudo apt-get install libiconv-hook-dev
- sudo apt-get install libncurses5-dev
④运行
安装完后,找了一遭,在这
第一次可以启动,但是后面再启动报错
- senrsl@senrsl-T540p:~/tools/SoftEtherVPN$ ll /usr/bin/vpn*
- -rwxr-xr-x 1 root root 48 10月 19 19:13 /usr/bin/vpnbridge*
- -rwxr-xr-x 1 root root 48 10月 19 19:13 /usr/bin/vpnclient*
- -rwxr-xr-x 1 root root 42 10月 19 19:13 /usr/bin/vpncmd*
- -rwxr-xr-x 1 root root 48 10月 19 19:13 /usr/bin/vpnserver*
然后。。。。我屮,原来是要加权限
- senrsl@senrsl-T540p:~$ vpnclient start
- -- Alert: SoftEther VPN Kernel --
- Fatal Error: The file "hamcore.se2" is missing or broken.
- Please check hamcore.se2.
- (First, reboot the computer. If this problem occurs again, please reinstall VPN software files.)
- senrsl@senrsl-T540p:~$ sudo vpnclient start
- [sudo] password for senrsl:
- The SoftEther VPN Client service has been started.
- senrsl@senrsl-T540p:~$
都启动起来
但是有毛用。。。。
- senrsl@senrsl-T540p:~$ sudo vpnbridge start
- The SoftEther VPN Bridge service has been started.
- senrsl@senrsl-T540p:~$ sudo vpnserver start
- The SoftEther VPN Server service has been started.
- senrsl@senrsl-T540p:~$ sudo vpnclient start
- The SoftEther VPN Client service has been started
不知道怎么用。。。。
3,github clone报 Permission denied (publickey).
查了好多解决方案,然后通过在github后台加publickey解决
查看本地ssl配置没有问题
- senrsl@senrsl-T540p:~/tools$ ssh-add -l
- 2048 df:a4:b8:7f:26:f3:5e:23:f2:81:75:**:cc:**:**:** senrsl@senrsl-T540p (RSA)
- senrsl@senrsl-T540p:~/tools$ git clone git@github.com:senRsl/SoftEtherVPN.git
- 正克隆到 'SoftEtherVPN'...
- Permission denied (publickey).
- fatal: Could not read from remote repository.
- Please make sure you have the correct access rights
- and the repository exists.
然后把public key加到后台去
就能下了
用了这么多年github,这问题真是新鲜(好像一直用的https之前。。。。)。。。。
- senrsl@senrsl-T540p:~/tools$ git clone git@github.com:senRsl/SoftEtherVPN.git
- 正克隆到 'SoftEtherVPN'...
- remote: Counting objects: 13454, done.
- ....
4,git clone代码莫名其妙消失
上面那个问题之前用https也可以,但是代码会莫名其妙消失,希望ssh方式不要消失。。。。
5,ubuntu14.04x64配置openvpn
安装openvpn
sudo apt-get -y install network-manager-openvpn
sudo NetworkManager restart
然后增加vpn的界面下面会有openvpn选项
使用easy rsa生成证书
- root@senrsl-T540p:/usr/share/easy-rsa# history
- 1 ./build-ca
- 2 ll
- 3 rm vars~
- 4 ll
- 5 source ./vars
- 6 ./clean-all
- 7 ./build-ca
- 8 ll keys/
- 9 cp keys/ca.crt ~senrsl/test/openvpn/
- 10 ./build-key-server SENRSL
- 11 ll keys/
- 12 ./build-dh
- 13 ll keys
- 14 cp keys/SENRSL.crt keys/SENRSL.key keys/dh2048.pem ~senrsl/test/openvpn/crt/Server/
- 15 ./build-key SENRSL
- 16 ./build-key senRsl_client
- 17 ll keys/
- 18 cp keys/senRsl_client.* ~senrsl/test/openvpn/crt/Client/
- 19 hisotry
- 20 history
- root@senrsl-T540p:/usr/share/easy-rsa#
然并卵
6,win Server2003搭建VPN Server
找到一个HK的服务器,再上面搭个VPN来下载。
恩,搭建直接用Server自带的管理工具里的路由什么的就OK,然后记得勾上PPTP什么的,ubuntu就能连接了。
7,ubuntu14.04x64VPN断线重连脚本
最终还是买了个VPN,240大洋。。。。
VPN会掉线,来个自动重连脚本
10秒循环监听。。。。
- senrsl@senrsl-T540p:~/test/vpn$ cat reconnect.sh
- #!/bin/bash
- user=senrsl #替换用户名
- vpnuuid=08ee8704-f0c2-49a2-aa80-7cf8be4b0f63 #替换UUID
- while true
- do
- if [[ "$(nmcli con status|grep $vpnuuid)" == "" ]]; then
- echo "Disconnected, trying to reconnect..."
- sleep 1s
- su $user -c "nmcli con up uuid $vpnuuid"
- else
- echo "Already connected !"
- fi
- sleep 10
- done
- #查看UUID
- #senrsl@senrsl-T540p:~$ nmcli con list
- #名称 UUID 类型 真实时间戳
- #云梯港1 08ee8704-f0c2-49a2-aa80-7cf8be4b0f63 vpn 2015年10月21日 星期三 17时28分50秒
- #启动脚本
- #senrsl@senrsl-T540p:~/test/vpn$ sudo su
- #[sudo] password for senrsl:
- #root@senrsl-T540p:/home/senrsl/test/vpn# ./reconnect.sh
- #Disconnected, trying to reconnect...
- #Already connected !
- senrsl@senrsl-T540p:~/test/vpn$
2015年10月23日16:04:45改以下
- #!/bin/bash
- user=senrsl #替换用户名
- vpnuuid=935ff099-c8a4-4909-a29e-88f5bb282e22 #替换UUID
- while true
- do
- if [[ "$(nmcli con status|grep $vpnuuid)" == "" ]]; then
- echo "Disconnected, trying to reconnect..."
- sleep 1s
- su $user -c "nmcli con up uuid $vpnuuid"
- else
- echo "already connected" `date`
- fi
- sleep 10
- done
- #查看UUID
- #senrsl@senrsl-T540p:~$ nmcli con list
- #名称 UUID 类型 真实时间戳
- #云梯港1 08ee8704-f0c2-49a2-aa80-7cf8be4b0f63 vpn 2015年10月21日 星期三 17时28分50秒
- #启动脚本
- #senrsl@senrsl-T540p:~/test/vpn$ sudo su
- #[sudo] password for senrsl:
- #root@senrsl-T540p:/home/senrsl/test/vpn# ./reconnect.sh
- #Disconnected, trying to reconnect...
- #Already connected !
8,使用iftop实时监测网络流量
linux下监测网络流量的工具有很多
选用iftop
然后就进入iftop的页面
- senrsl@senrsl-T540p:~$ sudo apt-get install iftop
- senrsl@senrsl-T540p:~$ sudo iftop -n
- interface: eth0
- IP address is: 192.168.21.2
- MAC address is: 54:ee:75:58:4b:05
虽然看不懂,但是感觉很厉害的样子。。。。
测试起来还是任务管理器里的比较准
另外可以使用mtr命令来看丢包
9,Failed to connect to android.googlesource.com port 443: Network is unreachable
下载android源码,下到100.1G的时候一直网络不可达。。。。
百思不得其解,明明挂VPN了好伐。。。。。
为什么挂了VPN还网络不可达。。。。
挂了一天看一个没多下,一直是91715.。。。。
然后晚上2015年11月02日20:53:42,翻了翻以前的记录。。。。
加上了
这么四句。。。。。突然就有速度了。。。。
- # download android source
- 74.125.71.82 www.googlesource.com
- 74.125.71.82 android.googlesource.com
- 203.208.46.172 cache.pack.google.com
- 59.24.3.173 cache.pack.google.com
然后立马变成91718了。。。。
然后ping一下地址
后面那俩压根ping不通的。。。。。
- senrsl@senrsl-T540p:~$ ping 74.125.71.82
- PING 74.125.71.82 (74.125.71.82) 56(84) bytes of data.
- 64 bytes from 74.125.71.82: icmp_seq=1 ttl=40 time=388 ms
- 64 bytes from 74.125.71.82: icmp_seq=2 ttl=40 time=402 ms
- ^Z
- [1]+ 已停止 ping 74.125.71.82
- senrsl@senrsl-T540p:~$ ping 203.208.46.172
- PING 203.208.46.172 (203.208.46.172) 56(84) bytes of data.
- ^Z
- [2]+ 已停止 ping 203.208.46.172
- senrsl@senrsl-T540p:~$ ping 59.24.3.173
- PING 59.24.3.173 (59.24.3.173) 56(84) bytes of data.
- ^Z
- [3]+ 已停止 ping 59.24.3.173
- senrsl@senrsl-T540p:~$
这也行。。。。。
10,源码体积已达125G
2015年11月04日10:43:38终于下完了
体积也一年大过一年
repo 120G.....
- senrsl@senrsl-T540p:~/android/source$ du -h --max-depth=1
- 122G ./WORKING_DIRECTORY
- 4.0K ./BW
- 3.1G ./kernel
- 170M ./test
- 32K ./bin
- 125G .
- senrsl@senrsl-T540p:~/android/source$
还真是越变越大哈。。。。
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ du -h --max-depth=1
- 46M ./libcore
- 224M ./cts
- 1.2G ./frameworks
- 9.1M ./docs
- 113G ./.repo
- 52M ./hardware
- 124M ./device
- 896K ./pdk
- 359M ./packages
- 11M ./build
- 128K ./abi
- 40M ./dalvik
- 118M ./development
- 4.2G ./prebuilts
- 2.7G ./external
- 18M ./bionic
- 13M ./art
- 12M ./system
- 18M ./developers
- 33M ./sdk
- 220K ./libnativehelper
- 77M ./ndk
- 230M ./tools
- 4.4M ./bootable
- 122G .
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$
11,使用ubuntu14.04.3x64编译android4.4.2源码
每次编译都有各种问题
配置缓存
安装依赖
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ export USE_CCACHE=1
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ mkdir ../.ccache
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ export CCACHE_DIR=~/android/source/.ccache
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ prebuilts/misc/linux-x86/ccache/ccache -M 50G
- Set cache size limit to 52428800k
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s
那个i386跟g++冲突,正着安一遍,反着验证一遍
- 1233 sudo apt-get install bison
- 1235 sudo apt-get install g++-multilib
- 1236 sudo apt-get install git
- 1237 sudo apt-get install gperf
- 1238 sudo apt-get install libxml2-utils
- 1239 sudo apt-get install make
- 1240 sudo apt-get install python-networkx
- 1241 sudo apt-get install zlib1g-dev:i386
- 1242 sudo apt-get install zip
- 1243 sudo apt-get autoremove
- 1244 sudo apt-get install zip
- 1245 sudo apt-get install zlib1g-dev:i386
- 1246 sudo apt-get install python-networkx
- 1247 sudo apt-get install make
- 1248 sudo apt-get install libxml2-utils
- 1249 sudo apt-get install gperf
- 1250 sudo apt-get install git
- 1251 sudo apt-get install g++-multilib
- 1252 sudo apt-get install bison
继续安依赖
senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ sudo apt-get install flex
编译通过,而且就吃顿饭的功夫。。。。。好快
12,刷入nexus7
刷完开不了机,这才想起来时没加驱动。。。。
翻翻以前的文章
烧源码http://senrsl.blogspot.jp/2015/04/android09nexus701.html
烧内核http://senrsl.blogspot.jp/2015/05/android09nexus702.html
goto 14
13,同步所有代码
想要make sdk
还是找以前的帖子http://senrsl.blogspot.jp/2015/08/android10.html
down完上面那个make sdk会报tools/base找不到,是因为默认代码不全。
使用
然后同步完成
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo init -g all
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo sync
这时查看大小
又大了不少
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ du -h --max-depth=1
- 23G ./out
- 46M ./libcore
- 224M ./cts
- 1.2G ./frameworks
- 9.1M ./docs
- 116G ./.repo
- 52M ./hardware
- 124M ./device
- 896K ./pdk
- 359M ./packages
- 11M ./build
- 128K ./abi
- 40M ./dalvik
- 118M ./development
- 4.9G ./prebuilts
- 2.7G ./external
- 18M ./bionic
- 13M ./art
- 12M ./system
- 18M ./developers
- 33M ./sdk
- 220K ./libnativehelper
- 77M ./ndk
- 1001M ./tools
- 4.4M ./bootable
- 150G .
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$
注:
- senrsl@senrsl-T540p:~$ repo help init
- Usage: repo init -u url [options]
- Options:
- -h, --help show this help message and exit
- Logging options:
- -q, --quiet be quiet
- Manifest options:
- -u URL, --manifest-url=URL
- manifest repository location
- -b REVISION, --manifest-branch=REVISION
- manifest branch or revision
- -m NAME.xml, --manifest-name=NAME.xml
- initial manifest file
- --mirror create a replica of the remote repositories rather
- than a client working directory
- --reference=DIR location of mirror directory
- --depth=DEPTH create a shallow clone with given depth; see git clone
- --archive checkout an archive instead of a git repository for
- each project. See git archive.
- -g GROUP, --groups=GROUP
- restrict manifest projects to ones with specified
- group(s) [default|all|G1,G2,G3|G4,-G5,-G6]
- -p PLATFORM, --platform=PLATFORM
- restrict manifest projects to ones with a specified
- platform group [auto|all|none|linux|darwin|...]
- repo Version options:
- --repo-url=URL repo repository location
- --repo-branch=REVISION
- repo branch or revision
- --no-repo-verify do not verify repo source code
- Other options:
- --config-name Always prompt for name/e-mail
- senrsl@senrsl-T540p:~$
14,增加nexus7的驱动编译烧写
nexus7驱动下载KVT49L版
https://developers.google.com/android/nexus/drivers#debkvt49l
15,make sdk
同步完所有代码后,便可make sdk.
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ lunch sdk-eng
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ make update-api
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ make sdk
- ......
- Install: out/host/linux-x86/bin/line_endings
- Package SDK: out/host/linux-x86/sdk/android-sdk_eng.senrsl_linux-x86.zip
- SDK: warning: including GNU target out/target/product/generic/system/lib/libgccdemangle.so
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ ls out/host/linux-x86/sdk/
- android-sdk_eng.senrsl_linux-x86 sdk_deps.mk
- android-sdk_eng.senrsl_linux-x86.zip
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$
16,repo start
看了半天没搞明白为什么要repo start,明明repo sync 默认的就可以用啊,默认的能用为什么还要repo start.....
然后找到了这张图
repo sync 之后紧跟 repo start....
据说是为各版本库创建分支,然后在该分支下工作。。。。
不明觉厉。。。。
尝试一下,倒是这个变了
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo branches
- (no branches)
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo start . --all
- error: '.' is not a valid name
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo start android-4.4.2_r2 --all
- Starting android-4.4.2_r2: 100% (418/418), done.
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo branches
- * android-4.4.2_r2 | in all projects
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo branch
- * android-4.4.2_r2 | in all projects
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$
17,部署
昨天下雨感冒发烧床上躺一天,今日下雪大蒜鸡蛋面下午喷嚏不断又不断。
能活到七老八十岁实在是太不容易了。。。。。。
也就是说代码分配应该是这样的:
.repo是总的项目库,需要哪个版本可以从里面检出来,然后切换分支对外发布。。。。
把上面442的目录都拷到另一个文件夹s442r2下,各种make验证。
然后编译源码跟sdk
- senrsl@senrsl-T540p:~/android/source/s442r2$ ll
- 总用量 112
- drwxrwxr-x 26 senrsl senrsl 4096 11月 6 14:53 ./
- drwxrwxr-x 9 senrsl senrsl 4096 11月 6 14:49 ../
- drwxrwxr-x 3 senrsl senrsl 4096 11月 4 05:53 abi/
- drwxrwxr-x 12 senrsl senrsl 4096 11月 4 05:53 art/
- drwxrwxr-x 10 senrsl senrsl 4096 11月 4 05:53 bionic/
- drwxrwxr-x 5 senrsl senrsl 4096 11月 4 05:53 bootable/
- drwxrwxr-x 7 senrsl senrsl 4096 11月 4 05:53 build/
- -rw-rw-r-- 1 senrsl senrsl 88 11月 4 14:10 BW
- drwxrwxr-x 11 senrsl senrsl 4096 11月 4 05:53 cts/
- drwxrwxr-x 16 senrsl senrsl 4096 11月 4 05:53 dalvik/
- drwxrwxr-x 6 senrsl senrsl 4096 11月 4 05:53 developers/
- drwxrwxr-x 18 senrsl senrsl 4096 11月 4 05:53 development/
- drwxrwxr-x 9 senrsl senrsl 4096 11月 4 05:53 device/
- drwxrwxr-x 3 senrsl senrsl 4096 11月 4 05:53 docs/
- drwxrwxr-x 171 senrsl senrsl 4096 11月 4 05:55 external/
- drwxrwxr-x 17 senrsl senrsl 4096 11月 4 05:56 frameworks/
- drwxrwxr-x 11 senrsl senrsl 4096 11月 4 05:56 hardware/
- drwxrwxr-x 17 senrsl senrsl 4096 11月 4 05:56 libcore/
- drwxrwxr-x 4 senrsl senrsl 4096 11月 4 05:56 libnativehelper/
- -r--r--r-- 1 senrsl senrsl 87 11月 4 05:53 Makefile
- drwxrwxr-x 8 senrsl senrsl 4096 11月 4 05:56 ndk/
- drwxrwxr-x 4 senrsl senrsl 4096 11月 6 14:54 out/ #后生
- drwxrwxr-x 9 senrsl senrsl 4096 11月 4 05:57 packages/
- drwxrwxr-x 6 senrsl senrsl 4096 11月 4 05:57 pdk/
- drwxrwxr-x 15 senrsl senrsl 4096 11月 5 00:41 prebuilts/
- drwxrwxr-x 26 senrsl senrsl 4096 11月 4 05:59 sdk/
- drwxrwxr-x 8 senrsl senrsl 4096 11月 4 05:59 system/
- drwxrwxr-x 11 senrsl senrsl 4096 11月 5 00:43 tools/
- senrsl@senrsl-T540p:~/android/source/s442r2$
此模式可压缩以进行单版本的分发!
然后再repo目录再检一份出来
恩,跟上面那个一模一样。。。。
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ ll
- 总用量 16
- drwxrwxr-x 3 senrsl senrsl 4096 11月 6 16:10 ./
- drwxrwxr-x 9 senrsl senrsl 4096 11月 6 14:49 ../
- drwxrwxr-x 7 senrsl senrsl 4096 11月 6 14:56 .repo/
- -rwxrwxr-x 1 senrsl senrsl 162 11月 2 20:47 sync.sh*
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo init -b android-4.4.2_r2 -g all
- Your identity is: senRsl <senRsl@163.com>
- If you want to change this, please re-run 'repo init' with --config-name
- repo has been initialized in /home/senrsl/android/source/WORKING_DIRECTORY
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo sync -j16
- ....
- Checking out files: 100% (182/182), done.ng out files: 1% (2/182)
- Checking out files: 100% (1256/1256), done.
- Checking out files: 100% (2951/2951), done.
- Checking out files: 100% (3416/3416), done. out files: 23% (801/3416)
- Checking out files: 100% (53361/53361), done.ut files: 1% (690/53361)
- Syncing work tree: 100% (418/418), done.
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$
又考虑一下,没必要单独把代码在本地搞得到处都是,可以按版本备份云盘外发,本地一份就够了,毕竟有repo做管理。
18,压缩备份版本前要make clean
之前
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ du -h --max-depth=1
- 44G ./out
- 46M ./libcore
- 224M ./cts
- 1.2G ./frameworks
- 9.1M ./docs
- 116G ./.repo
- 52M ./hardware
- 124M ./device
- 896K ./pdk
- 359M ./packages
- 11M ./build
- 128K ./abi
- 40M ./dalvik
- 118M ./development
- 4.9G ./prebuilts
- 2.7G ./external
- 18M ./bionic
- 13M ./art
- 12M ./system
- 18M ./developers
- 33M ./sdk
- 220K ./libnativehelper
- 77M ./ndk
- 1001M ./tools
- 4.4M ./bootable
- 291G .
之后
之前只比之后多了一个44G的out,但总体积291-127-44=120;这120隐藏在源码的各个角落,
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ du -h --max-depth=1
- 46M ./libcore
- 224M ./cts
- 1.2G ./frameworks
- 9.1M ./docs
- 116G ./.repo
- 52M ./hardware
- 124M ./device
- 896K ./pdk
- 359M ./packages
- 11M ./build
- 128K ./abi
- 40M ./dalvik
- 118M ./development
- 4.9G ./prebuilts
- 2.7G ./external
- 18M ./bionic
- 13M ./art
- 12M ./system
- 18M ./developers
- 33M ./sdk
- 220K ./libnativehelper
- 77M ./ndk
- 1001M ./tools
- 4.4M ./bootable
- 127G .
之前压缩tar.gz 128G+....
之后压缩tar.gz ...
看来还要把源码换个位置再压缩,他们顺着引用找过去了
那么多文件拷的太慢了,还是把.repo改个名字好了,这样引用一样找不到。。。。
19,android 模拟手势
模拟事件全部是通过input命令来实现的,首先看一下input命令的使用:
- usage: input ...
- input text <string>
- input keyevent <key code number or name>
- input [touchscreen|touchpad] tap <x> <y>
- input [touchscreen|touchpad] swipe <x1> <y1> <x2> <y2>
- input trackball press
- input trackball roll <dx> <dy>
1. keyevent指的是android对应的keycode,比如home键的keycode=3,back键的keycode=4.
具体请查阅 <android keycode详解>
- KEYCODE_UNKNOWN=0;
- KEYCODE_SOFT_LEFT=1;
- KEYCODE_SOFT_RIGHT=2;
- KEYCODE_HOME=3;
- KEYCODE_BACK=4;
- KEYCODE_CALL=5;
- KEYCODE_ENDCALL=6;
- KEYCODE_0=7;
- KEYCODE_1=8;
- KEYCODE_2=9;
- KEYCODE_3=10;
- KEYCODE_4=11;
- KEYCODE_5=12;
- KEYCODE_6=13;
- KEYCODE_7=14;
- KEYCODE_8=15;
- KEYCODE_9=16;
- KEYCODE_STAR=17;
- KEYCODE_POUND=18;
- KEYCODE_DPAD_UP=19;
- KEYCODE_DPAD_DOWN=20;
- KEYCODE_DPAD_LEFT=21;
- KEYCODE_DPAD_RIGHT=22;
- KEYCODE_DPAD_CENTER=23;
- KEYCODE_VOLUME_UP=24;
- KEYCODE_VOLUME_DOWN=25;
- KEYCODE_POWER=26;
- KEYCODE_CAMERA=27;
- KEYCODE_CLEAR=28;
- KEYCODE_A=29;
- KEYCODE_B=30;
- KEYCODE_C=31;
- KEYCODE_D=32;
- KEYCODE_E=33;
- KEYCODE_F=34;
- KEYCODE_G=35;
- KEYCODE_H=36;
- KEYCODE_I=37;
- KEYCODE_J=38;
- KEYCODE_K=39;
- KEYCODE_L=40;
- KEYCODE_M=41;
- KEYCODE_N=42;
- KEYCODE_O=43;
- KEYCODE_P=44;
- KEYCODE_Q=45;
- KEYCODE_R=46;
- KEYCODE_S=47;
- KEYCODE_T=48;
- KEYCODE_U=49;
- KEYCODE_V=50;
- KEYCODE_W=51;
- KEYCODE_X=52;
- KEYCODE_Y=53;
- KEYCODE_Z=54;
- KEYCODE_COMMA=55;
- KEYCODE_PERIOD=56;
- KEYCODE_ALT_LEFT=57;
- KEYCODE_ALT_RIGHT=58;
- KEYCODE_SHIFT_LEFT=59;
- KEYCODE_SHIFT_RIGHT=60;
- KEYCODE_TAB=61;
- KEYCODE_SPACE=62;
- KEYCODE_SYM=63;
- KEYCODE_EXPLORER=64;
- KEYCODE_ENVELOPE=65;
- KEYCODE_ENTER=66;
- KEYCODE_DEL=67;
- KEYCODE_GRAVE=68;
- KEYCODE_MINUS=69;
- KEYCODE_EQUALS=70;
- KEYCODE_LEFT_BRACKET=71;
- KEYCODE_RIGHT_BRACKET=72;
- KEYCODE_BACKSLASH=73;
- KEYCODE_SEMICOLON=74;
- KEYCODE_APOSTROPHE=75;
- KEYCODE_SLASH=76;
- KEYCODE_AT=77;
- KEYCODE_NUM=78;
- KEYCODE_HEADSETHOOK=79;
- KEYCODE_FOCUS=80;//*Camera*focus
- KEYCODE_PLUS=81;
- KEYCODE_MENU=82;
- KEYCODE_NOTIFICATION=83;
- KEYCODE_SEARCH=84;
- KEYCODE_MEDIA_PLAY_PAUSE=85;
- KEYCODE_MEDIA_STOP=86;
- KEYCODE_MEDIA_NEXT=87;
- KEYCODE_MEDIA_PREVIOUS=88;
- KEYCODE_MEDIA_REWIND=89;
- KEYCODE_MEDIA_FAST_FORWARD=90;
- KEYCODE_MUTE=91;
然后使用的话比较简单,比如想模拟home按键:
adb shell input keyevent 3
根据具体keycode编辑即可。
2. 关于tap的话,他模拟的是touch屏幕的事件,只需给出x、y坐标即可。
此x、y坐标对应的是真实的屏幕分辨率,所以要根据具体手机具体看,比如你想点击屏幕(x, y) = (250, 250)位置:
adb shell input tap 250 250
3. 关于swipe同tap是一样的,只是他是模拟滑动的事件,给出起点和终点的坐标即可。例如从屏幕(250, 250), 到屏幕(300, 300)即
adb shell input swipe 250 250 300 300
input touchscreen swipe 700 200 100 200
相关源码定义在/home/senrsl/android/source/WORKING_DIRECTORY/frameworks/base /cmds/input/src/com/android/commands/input/Input.java文件
写个脚本,加后台运行即可
后台脚本运行测试
- senrsl@senrsl-T540p:~$ adb shell
- root@android:/ # sh /usr1/test.sh &
- root@android:/ # cat /usr1/test.sh
- while true
- do
- input keyevent BACK
- sleep 1
- input keyevent HOME
- sleep 0.2
- am start -n com.dc.customtailorcar.media/com.dc.customtailorcar.media.MediaActivity
- sleep 10
- input tap 200 400
- sleep 2
- input keyevent BACK
- sleep 10
- input tap 750 450
- sleep 2
- input swipe 50 230 800 220
- sleep 0.2
- input swipe 700 230 100 220
- sleep 0.2
- input keyevent BACK
- sleep 10
- echo _____
- done
- root@android:/ #
20,android api level 对照SDK版本
- API等级1: Android 1.0
- API等级2: Android 1.1 Petit Four 花式小蛋糕
- API等级3: Android 1.5 Cupcake 纸杯蛋糕
- API等级4: Android 1.6 Donut 甜甜圈
- API等级5: Android 2.0 Éclair 松饼
- API等级6: Android 2.0.1 Éclair 松饼
- API等级7: Android 2.1 Éclair 松饼
- API等级8: Android 2.2 - 2.2.3 Froyo 冻酸奶
- API等级9: Android 2.3 - 2.3.2 Gingerbread 姜饼
- API等级10:Android 2.3.3-2.3.7 Gingerbread 姜饼
- API等级11:Android 3.0 Honeycomb 蜂巢
- API等级12:Android 3.1 Honeycomb 蜂巢
- API等级13:Android 3.2 Honeycomb 蜂巢
- API等级14:Android 4.0 - 4.0.2 Ice Cream Sandwich 冰激凌三明治
- API等级15:Android 4.0.3 - 4.0.4 Ice Cream Sandwich 冰激凌三明治
- API等级16:Android 4.1 Jelly Bean 糖豆
- API等级17:Android 4.2 Jelly Bean 糖豆
- API等级18:Android 4.3 Jelly Bean 糖豆
- API等级19:Android 4.4 KitKat 奇巧巧克力棒
- API等级20 : Android 4.4W KitKat with wearable extensions 奇巧巧克力棒
- API等级21:Android 5.0-5.0.2 Lollipop 棒棒糖
21,android auto
搭建一套android auto环境
PC上搭车机端虚拟机,手机上装客户端。
万事俱备,没支持google play的5.0+手机。。。。
编源码,刷6.0N7.
1)切换分支到6.0
2)装驱动
3)编译
4)烧录
烧录完成看效果
- senrsl@senrsl-T540p:~$ cd android/source/WORKING_DIRECTORY/
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ ll
- 总用量 20172
- drwxrwxr-x 28 senrsl senrsl 4096 11月 12 15:27 ./
- drwxrwxr-x 9 senrsl senrsl 4096 11月 12 16:36 ../
- drwxrwxr-x 3 senrsl senrsl 4096 11月 6 16:26 abi/
- drwxrwxr-x 12 senrsl senrsl 4096 11月 6 16:26 art/
- drwxrwxr-x 10 senrsl senrsl 4096 11月 6 16:26 bionic/
- drwxrwxr-x 5 senrsl senrsl 4096 11月 6 16:26 bootable/
- drwxrwxr-x 7 senrsl senrsl 4096 11月 6 16:26 build/
- -rw-rw-r-- 1 senrsl senrsl 5923 11月 9 14:32 BW
- drwxrwxr-x 11 senrsl senrsl 4096 11月 6 16:27 cts/
- drwxrwxr-x 16 senrsl senrsl 4096 11月 6 16:27 dalvik/
- drwxrwxr-x 6 senrsl senrsl 4096 11月 6 16:27 developers/
- drwxrwxr-x 18 senrsl senrsl 4096 11月 6 16:27 development/
- drwxrwxr-x 9 senrsl senrsl 4096 11月 6 16:27 device/
- drwxrwxr-x 3 senrsl senrsl 4096 11月 6 16:27 docs/
- drwxrwxr-x 171 senrsl senrsl 4096 11月 6 16:31 external/
- -rwxr-x--x 1 senrsl senrsl 149120 2月 7 2014 extract-asus-deb.sh*
- -rwxr-x--x 1 senrsl senrsl 23590 2月 7 2014 extract-broadcom-deb.sh*
- -rwxr-x--x 1 senrsl senrsl 20347858 2月 7 2014 extract-qcom-deb.sh*
- drwxrwxr-x 17 senrsl senrsl 4096 11月 6 16:32 frameworks/
- drwxrwxr-x 11 senrsl senrsl 4096 11月 6 16:32 hardware/
- drwxrwxr-x 17 senrsl senrsl 4096 11月 6 16:32 libcore/
- drwxrwxr-x 4 senrsl senrsl 4096 11月 6 16:32 libnativehelper/
- -r--r--r-- 1 senrsl senrsl 87 11月 6 16:26 Makefile
- drwxrwxr-x 8 senrsl senrsl 4096 11月 6 16:32 ndk/
- drwxrwxr-x 4 senrsl senrsl 4096 11月 12 15:28 out/
- drwxrwxr-x 9 senrsl senrsl 4096 11月 6 16:32 packages/
- drwxrwxr-x 6 senrsl senrsl 4096 11月 6 16:33 pdk/
- drwxrwxr-x 15 senrsl senrsl 4096 11月 6 16:35 prebuilts/
- drwxrwxr-x 7 senrsl senrsl 4096 11月 6 16:21 .repo/
- drwxrwxr-x 26 senrsl senrsl 4096 11月 6 16:35 sdk/
- -rwxrwxr-x 1 senrsl senrsl 162 11月 2 20:47 sync.sh*
- drwxrwxr-x 8 senrsl senrsl 4096 11月 6 16:35 system/
- drwxrwxr-x 11 senrsl senrsl 4096 11月 6 16:36 tools/
- drwxr-x--- 5 senrsl senrsl 4096 2月 7 2014 vendor/
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo branches
- android-4.4.2_r2 | in all projects
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ cd .repo/manifests
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY/.repo/manifests$ git branch -a | cut -d / -f 3
- * default
- android-4.4.2_r2 -> origin
- adt_23.0.3
- android-1.6_r1
- android-1.6_r1.1
- android-1.6_r1.2
- android-1.6_r1.3
- android-1.6_r1.4
- android-1.6_r1.5
- android-1.6_r2
- android-2.0.1_r1
- android-2.0_r1
- android-2.1_r1
- android-2.1_r2
- android-2.1_r2.1p
- android-2.1_r2.1p2
- android-2.1_r2.1s
- android-2.2.1_r1
- android-2.2.1_r2
- android-2.2.2_r1
- android-2.2.3_r1
- android-2.2.3_r2
- android-2.2.3_r2.1
- android-2.2_r1
- android-2.2_r1.1
- android-2.2_r1.2
- android-2.2_r1.3
- android-2.3.1_r1
- android-2.3.2_r1
- android-2.3.3_r1
- android-2.3.3_r1.1
- android-2.3.4_r0.9
- android-2.3.4_r1
- android-2.3.5_r1
- android-2.3.6_r0.9
- android-2.3.6_r1
- android-2.3.7_r1
- android-2.3_r1
- android-4.0.1_r1
- android-4.0.1_r1.1
- android-4.0.1_r1.2
- android-4.0.2_r1
- android-4.0.3_r1
- android-4.0.3_r1.1
- android-4.0.4_r1
- android-4.0.4_r1.1
- android-4.0.4_r1.2
- android-4.0.4_r2
- android-4.0.4_r2.1
- android-4.1.1_r1
- android-4.1.1_r1.1
- android-4.1.1_r2
- android-4.1.1_r3
- android-4.1.1_r4
- android-4.1.1_r5
- android-4.1.1_r6
- android-4.1.1_r6.1
- android-4.1.2_r1
- android-4.1.2_r2
- android-4.1.2_r2.1
- android-4.2.1_r1
- android-4.2.1_r1.1
- android-4.2.1_r1.2
- android-4.2.2_r1
- android-4.2.2_r1.1
- android-4.2.2_r1.2
- android-4.2.2_r1.2b
- android-4.2_r1
- android-4.3.1_r1
- android-4.3_r0.9
- android-4.3_r0.9.1
- android-4.3_r1
- android-4.3_r1.1
- android-4.3_r2
- android-4.3_r2.1
- android-4.3_r2.2
- android-4.3_r2.2-cts
- android-4.3_r2.3
- android-4.3_r3
- android-4.3_r3.1
- android-4.4.1_r1
- android-4.4.1_r1.0.1
- android-4.4.2_r1
- android-4.4.2_r1.0.1
- android-4.4.2_r2
- android-4.4.2_r2.0.1
- android-4.4.3_r1
- android-4.4.3_r1.0.1
- android-4.4.3_r1.1
- android-4.4.3_r1.1.0.1
- android-4.4.4_r1
- android-4.4.4_r1.0.1
- android-4.4.4_r2
- android-4.4.4_r2.0.1
- android-4.4_r1
- android-4.4_r1.0.1
- android-4.4_r1.1
- android-4.4_r1.1.0.1
- android-4.4_r1.2
- android-4.4_r1.2.0.1
- android-4.4w_r1
- android-5.0.0_r1
- android-5.0.0_r1.0.1
- android-5.0.0_r2
- android-5.0.0_r2.0.1
- android-5.0.0_r3
- android-5.0.0_r3.0.1
- android-5.0.0_r4
- android-5.0.0_r4.0.1
- android-5.0.0_r5
- android-5.0.0_r5.0.1
- android-5.0.0_r5.1
- android-5.0.0_r5.1.0.1
- android-5.0.0_r6
- android-5.0.0_r6.0.1
- android-5.0.0_r7
- android-5.0.0_r7.0.1
- android-5.0.1_r1
- android-5.0.2_r1
- android-5.0.2_r3
- android-5.1.0_r1
- android-5.1.0_r3
- android-5.1.0_r4
- android-5.1.0_r5
- android-5.1.1_r1
- android-5.1.1_r10
- android-5.1.1_r12
- android-5.1.1_r13
- android-5.1.1_r14
- android-5.1.1_r15
- android-5.1.1_r16
- android-5.1.1_r17
- android-5.1.1_r18
- android-5.1.1_r19
- android-5.1.1_r2
- android-5.1.1_r20
- android-5.1.1_r22
- android-5.1.1_r23
- android-5.1.1_r24
- android-5.1.1_r25
- android-5.1.1_r26
- android-5.1.1_r28
- android-5.1.1_r3
- android-5.1.1_r4
- android-5.1.1_r5
- android-5.1.1_r6
- android-5.1.1_r7
- android-5.1.1_r8
- android-5.1.1_r9
- android-6.0.0_r1
- android-6.0.0_r11
- android-6.0.0_r12
- android-6.0.0_r13
- android-6.0.0_r2
- android-6.0.0_r23
- android-6.0.0_r24
- android-6.0.0_r25
- android-6.0.0_r26
- android-6.0.0_r4
- android-6.0.0_r5
- android-cts-2.2_r8
- android-cts-2.3_r10
- android-cts-2.3_r11
- android-cts-2.3_r12
- android-cts-4.0.3_r1
- android-cts-4.0.3_r2
- android-cts-4.0_r1
- android-cts-4.1_r1
- android-cts-4.1_r2
- android-cts-4.1_r4
- android-cts-4.2_r2
- android-cts-4.4_r4
- android-cts-5.0_r2
- android-cts-5.0_r3
- android-cts-5.1_r1
- android-cts-5.1_r2
- android-cts-5.1_r3
- android-cts-6.0_r1
- android-cts-verifier-4.0.3_r1
- android-cts-verifier-4.0_r1
- android-l-preview_r2
- android-live-tv
- android-live-tv-l-mr1
- android-m-preview
- android-m-preview-1
- android-m-preview-2
- android-sdk-4.0.3-tools_r1
- android-sdk-4.0.3_r1
- android-sdk-4.4.2_r1
- android-sdk-4.4.2_r1.0.1
- android-sdk-adt_r16.0.1
- android-sdk-adt_r20
- android-sdk-support_r11
- android-support-test
- android-tsl-2.0
- android-tsl-3.0
- android-tsl-4.0
- android-wear-5.0.0_r1
- android-wear-5.1.0_r1
- android-wear-5.1.1_r1
- chromium-dev
- droiddriver-dev
- emu-1.4-release
- emu-master-dev
- froyo
- gcc
- gingerbread
- gingerbread-release
- gradle-dev
- gradle_0.12.2
- gradle_0.13.0
- gradle_0.13.1
- gradle_0.13.2
- gradle_0.13.3
- gradle_0.14.0
- gradle_0.14.1
- gradle_0.14.2
- gradle_0.14.3
- gradle_0.14.4
- gradle_1.0.0
- gradle_1.0.0-rc1
- gradle_1.0.0-rc2
- gradle_1.0.0-rc3
- gradle_1.0.0-rc4
- gradle_1.0.1
- gradle_1.1.0
- gradle_1.1.0-rc1
- gradle_1.1.0-rc2
- gradle_1.1.0-rc3
- gradle_1.1.1
- gradle_1.1.2
- gradle_1.1.3
- gradle_1.2.0
- gradle_1.2.0-beta1
- gradle_1.2.0-rc1
- gradle_1.2.1
- gradle_1.2.2
- gradle_1.2.3
- gradle_1.3.0-beta1
- gradle_1.3.0-beta2
- gradle_1.3.0-beta3
- gradle_1.3.0-beta4
- gradle_1.3.1
- ics-mr0
- ics-mr1
- ics-plus-aosp
- idea133
- idea133-weekly-release
- jb-dev
- jb-mr1-dev
- jb-mr1-dev-plus-aosp
- jb-mr1.1-cts-dev
- jb-mr1.1-dev
- jb-mr1.1-dev-plus-aosp
- jb-mr2-cts-dev
- jb-mr2-dev
- jumper-stable
- kitkat-cts-dev
- kitkat-dev
- l-preview
- lldb-master-dev
- llvm
- lollipop-cts-dev
- lollipop-dev
- lollipop-mr1-cts-dev
- lollipop-mr1-dev
- marshmallow-cts-dev
- marshmallow-cts-release
- marshmallow-dev
- marshmallow-dr-dev
- master
- master-art
- master-art-host
- master-dalvik
- master-dalvik-host
- master-ndk
- master-soong
- studio-1.0-dev
- studio-1.0-release
- studio-1.1-dev
- studio-1.1-release
- studio-1.2-dev
- studio-1.2-release
- studio-1.3-dev
- studio-1.3-release
- studio-1.4
- studio-1.4-dev
- studio-1.4-lldb-dev
- studio-1.4-release
- studio-master-dev
- studio-master-release
- studio_0.8.6
- studio_1.0.0
- studio_1.0.1
- tools-canary-release
- tools_ndk_r9d
- tools_r20
- tools_r21
- tools_r21.1
- tools_r22
- tools_r22.2
- tools_r22.6
- tradefed
- ub-emulator-master
- ub-jack
- ub-jack-arzon
- ub-jack-arzon-mr2
- ub-jack-brest
- ub-jack-lang-dev
- ub-tools-idea133
- ub-tools-idea133-milestone
- ub-tools-idea133-release
- ub-tools-master
- ub-webview-m40-release
- upstream-mirror-lldb
- webview-m40_r1
- webview-m40_r2
- webview-m40_r3
- webview-m40_r4
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY/.repo/manifests$ cd ..
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY/.repo$ cd ..
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo init -b android-6.0.0_r26 -g all
- remote: Counting objects: 2, done
- remote: Finding sources: 100% (29/29)
- remote: Total 29 (delta 6), reused 29 (delta 6)
- 来自 https://android.googlesource.com/platform/manifest
- * [新分支] android-5.1.1_r29 -> origin/android-5.1.1_r29
- * [新分支] android-6.0.0_r3 -> origin/android-6.0.0_r3
- * [新分支] android-cts-5.1_r4 -> origin/android-cts-5.1_r4
- 90c4670..73789ba llvm -> origin/llvm
- 9cf96e9..55eadd0 marshmallow-cts-dev -> origin/marshmallow-cts-dev
- 9cf96e9..24fda7a marshmallow-cts-release -> origin/marshmallow-cts-release
- 1d80758..7d3ba4e master -> origin/master
- 4488a1e..40e1061 master-art -> origin/master-art
- * [新tag] android-5.1.1_r29 -> android-5.1.1_r29
- * [新tag] android-6.0.0_r3 -> android-6.0.0_r3
- Your identity is: senRsl <senRsl@163.com>
- If you want to change this, please re-run 'repo init' with --config-name
- repo has been initialized in /home/senrsl/android/source/WORKING_DIRECTORY
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$
- repo sync好久 终于看到这句
- Fetching project platform/developers/build
- Fetching project platform/hardware/ti/omap4-aah
- Fetching project device/generic/arm64
- Fetching projects: 96% (437/455) Fetching project platform/external/fio
- Fetching project platform/external/jack
- Fetching project platform/external/marisa-trie
- Fetching projects: 99% (451/455) remote: Total 14 (delta 4), reused 14 (delta 4)
- 来自 https://android.googlesource.com/platform/tools/external/gradle
- f2fb952..6b5dbec studio-master-dev -> aosp/studio-master-dev
- * [新tag] studio-1.5 -> studio-1.5
- Fetching projects: 100% (455/455), done.
- Syncing work tree: 100% (455/455), done.
- 然后start
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo start android-6.0.0_r26 --all
- Starting android-6.0.0_r26: 100% (455/455), done.
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ repo branches
- android-4.4.2_r2 | not in:
- device/asus/fugu
- device/asus/fugu-kernel
- device/generic/arm64
- device/generic/mini-emulator-arm64
- device/generic/mini-emulator-x86_64
- device/generic/qemu
- device/generic/x86_64
- device/google/atv
- device/htc/flounder
- device/htc/flounder-kernel
- device/huawei/angler
- device/huawei/angler-kernel
- device/lge/bullhead
- device/lge/bullhead-kernel
- device/moto/shamu
- device/moto/shamu-kernel
- external/androidplot
- external/apache-commons-math
- external/boringssl
- external/cblas
- external/chromium-webview
- external/cmockery
- external/conscrypt
- external/crcalc
- external/deqp
- external/donuts
- external/drm_gralloc
- external/drm_hwcomposer
- external/f2fs-tools
- external/fio
- external/fonttools
- external/glide
- external/google-breakpad
- external/google-fonts/carrois-gothic-sc
- external/google-fonts/coming-soon
- external/google-fonts/cutive-mono
- external/google-fonts/dancing-script
- external/google-tv-pairing-protocol
- external/gptfdisk
- external/hyphenation-patterns
- external/icu
- external/jarjar
- external/jemalloc
- external/jetty
- external/jsmn
- external/jsoncpp
- external/ksoap2
- external/libavc
- external/libcxx
- external/libcxxabi
- external/libdrm
- external/libedit
- external/libexif
- external/libhevc
- external/libmpeg2
- external/libnl
- external/libopus
- external/libseccomp-helper
- external/libssh2
- external/libunwind
- external/libutf
- external/libvncserver
- external/libvterm
- external/lld
- external/lldb
- external/ltrace
- external/lz4
- external/messageformat
- external/mockftpserver
- external/nanohttpd
- external/nanopb-c
- external/nfacct
- external/owasp/sanitizer
- external/parameter-framework
- external/pcre
- external/pdfium
- external/roboto-fonts
- external/selinux
- external/slf4j
- external/sonic
- external/squashfs-tools
- external/toybox
- external/vboot_reference
- external/vixl
- external/vogar
- external/zopfli
- frameworks/data-binding
- frameworks/minikin
- frameworks/multidex
- frameworks/opt/bitmap
- frameworks/opt/bluetooth
- frameworks/opt/chips
- frameworks/opt/inputconnectioncommon
- frameworks/opt/net/ethernet
- frameworks/opt/net/ims
- frameworks/opt/net/wifi
- frameworks/opt/setupwizard
- frameworks/opt/widget
- hardware/intel/audio_media
- hardware/intel/bootstub
- hardware/intel/common/bd_prov
- hardware/intel/common/libmix
- hardware/intel/common/libstagefrighthw
- hardware/intel/common/libva
- hardware/intel/common/libwsbm
- hardware/intel/common/omx-components
- hardware/intel/common/utils
- hardware/intel/common/wrs_omxil_core
- hardware/intel/img/hwcomposer
- hardware/intel/img/psb_headers
- hardware/intel/img/psb_video
- hardware/intel/sensors
- hardware/marvell/bt
- hardware/mediatek
- hardware/nvidia/audio
- hardware/qcom/gps
- hardware/qcom/msm8994
- hardware/qcom/msm8x26
- hardware/qcom/msm8x27
- hardware/qcom/msm8x84
- hardware/ti/omap4-aah
- packages/apps/CarrierConfig
- packages/apps/ExactCalculator
- packages/apps/FMRadio
- packages/apps/ManagedProvisioning
- packages/apps/Messaging
- packages/apps/Terminal
- packages/apps/TvSettings
- packages/providers/BookmarkProvider
- packages/providers/CallLogProvider
- packages/providers/TvProvider
- packages/services/Mms
- packages/services/Telecomm
- platform_testing
- prebuilts/android-emulator
- prebuilts/clang/darwin-x86/host/3.6
- prebuilts/clang/linux-x86/host/3.6
- prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9
- prebuilts/gcc/darwin-x86/arm/arm-eabi-4.8
- prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.9
- prebuilts/gcc/darwin-x86/mips/mips64el-linux-android-4.9
- prebuilts/gcc/darwin-x86/x86/x86_64-linux-android-4.9
- prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9
- prebuilts/gcc/linux-x86/arm/arm-eabi-4.8
- prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9
- prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8
- prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8
- prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8
- prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9
- prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9
- prebuilts/gradle-plugin
- prebuilts/libs/libedit
- prebuilts/maven_repo/android
- system/bt
- system/gatekeeper
- system/keymaster
- * android-6.0.0_r26 | in all projects
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$
- 然后安上三个驱动,编译
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ source ./build/envsetup.sh
- including device/asus/deb/vendorsetup.sh
- including device/asus/flo/vendorsetup.sh
- including device/asus/fugu/vendorsetup.sh
- including device/generic/mini-emulator-arm64/vendorsetup.sh
- including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
- including device/generic/mini-emulator-mips/vendorsetup.sh
- including device/generic/mini-emulator-x86_64/vendorsetup.sh
- including device/generic/mini-emulator-x86/vendorsetup.sh
- including device/htc/flounder/vendorsetup.sh
- including device/huawei/angler/vendorsetup.sh
- including device/lge/bullhead/vendorsetup.sh
- including device/lge/hammerhead/vendorsetup.sh
- including device/moto/shamu/vendorsetup.sh
- including sdk/bash_completion/adb.bash
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ lunch
- You're building on Linux
- Lunch menu... pick a combo:
- 1. aosp_arm-eng
- 2. aosp_arm64-eng
- 3. aosp_mips-eng
- 4. aosp_mips64-eng
- 5. aosp_x86-eng
- 6. aosp_x86_64-eng
- 7. aosp_deb-userdebug
- 8. aosp_flo-userdebug
- 9. full_fugu-userdebug
- 10. aosp_fugu-userdebug
- 11. mini_emulator_arm64-userdebug
- 12. m_e_arm-userdebug
- 13. mini_emulator_mips-userdebug
- 14. mini_emulator_x86_64-userdebug
- 15. mini_emulator_x86-userdebug
- 16. aosp_flounder-userdebug
- 17. aosp_angler-userdebug
- 18. aosp_bullhead-userdebug
- 19. aosp_hammerhead-userdebug
- 20. aosp_hammerhead_fp-userdebug
- 21. aosp_shamu-userdebug
- Which would you like? [aosp_arm-eng] 7
- ============================================
- PLATFORM_VERSION_CODENAME=REL
- PLATFORM_VERSION=6.0
- TARGET_PRODUCT=aosp_deb
- TARGET_BUILD_VARIANT=userdebug
- TARGET_BUILD_TYPE=release
- TARGET_BUILD_APPS=
- TARGET_ARCH=arm
- TARGET_ARCH_VARIANT=armv7-a-neon
- TARGET_CPU_VARIANT=krait
- TARGET_2ND_ARCH=
- TARGET_2ND_ARCH_VARIANT=
- TARGET_2ND_CPU_VARIANT=
- HOST_ARCH=x86_64
- HOST_OS=linux
- HOST_OS_EXTRA=Linux-3.19.0-28-generic-x86_64-with-Ubuntu-14.04-trusty
- HOST_BUILD_TYPE=release
- BUILD_ID=MDB08M
- OUT_DIR=out
- ============================================
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$
- 需要使用openjdk7.....
- 安装openjdk7,【23】
- 安装依赖
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip
- 然后编译android source 6.0.0r26
- ....
- make_ext4fs -s -T -1 -S out/target/product/deb/root/file_contexts -L system -l 880803840 -J -a system out/target/product/deb/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/deb/system out/target/product/deb/system
- Creating filesystem with parameters:
- Size: 880803840
- Block size: 4096
- Blocks per group: 32768
- Inodes per group: 7680
- Inode size: 256
- Journal blocks: 0
- Label: system
- Blocks: 215040
- Block groups: 7
- Reserved block group size: 55
- Created filesystem with 1713/53760 inodes and 97056/215040 blocks
- Install system fs image: out/target/product/deb/system.img
- out/target/product/deb/system.img+out/target/product/deb/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p maxsize=899137536 blocksize=135168 total=385506217 reserve=9191424
- #### make completed successfully (22:28 (mm:ss)) ####
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$
- 编译完成
- 烧录
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ adb reboot bootloader
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ export ANDROID_PRODUCT_OUT=/home/senrsl/android/source/WORKING_DIRECTORY/out/target/product/deb
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$ fastboot -w flashall
- Creating filesystem with parameters:
- Size: 28521246720
- Block size: 4096
- Blocks per group: 32768
- Inodes per group: 8176
- Inode size: 256
- Journal blocks: 32768
- Label:
- Blocks: 6963195
- Block groups: 213
- Reserved block group size: 1024
- Created filesystem with 11/1741488 inodes and 153337/6963195 blocks
- Creating filesystem with parameters:
- Size: 587202560
- Block size: 4096
- Blocks per group: 32768
- Inodes per group: 7168
- Inode size: 256
- Journal blocks: 2240
- Label:
- Blocks: 143360
- Block groups: 5
- Reserved block group size: 39
- Created filesystem with 11/35840 inodes and 4616/143360 blocks
- --------------------------------------------
- Bootloader Version...: FLO-04.05
- Baseband Version.....: DEB-Z00_2.44.0_0213
- Serial Number........: 0a6aad85
- --------------------------------------------
- checking product...
- OKAY [ 0.003s]
- sending 'boot' (7466 KB)...
- OKAY [ 0.241s]
- writing 'boot'...
- OKAY [ 0.821s]
- sending 'recovery' (8212 KB)...
- OKAY [ 0.264s]
- writing 'recovery'...
- OKAY [ 0.284s]
- erasing 'system'...
- OKAY [ 0.180s]
- sending 'system' (376062 KB)...
- OKAY [ 11.788s]
- writing 'system'...
- OKAY [ 17.180s]
- erasing 'userdata'...
- OKAY [ 2.937s]
- sending 'userdata' (139065 KB)...
- OKAY [ 4.361s]
- writing 'userdata'...
- OKAY [ 5.658s]
- erasing 'cache'...
- OKAY [ 0.075s]
- sending 'cache' (10984 KB)...
- OKAY [ 0.351s]
- writing 'cache'...
- OKAY [ 0.457s]
- rebooting...
- finished. total time: 44.666s
- senrsl@senrsl-T540p:~/android/source/WORKING_DIRECTORY$
这个是昨天烧的镜像的
这个刚烧的编译完成的
看来有必要等repo服务部完改一下重烧。。。。
然后装android auto的那几个apk
goto24
22,win7共享wifi开启vpn.txt
一定要按顺序
1,建立vpn,保持关闭状态
2,建立虚拟网卡
C:\Windows\system32>netsh wlan set hostednetwork mode=allow ssid=SENRSL_WIN7 key
=01234567
承载网络模式已设置为允许。
已成功更改承载网络的 SSID。
已成功更改托管网络的用户密钥密码。
3,将vpn共享指向到虚拟网卡,下面设置按钮配置如下
4,启动虚拟网卡
C:\Windows\system32>netsh wlan start hostednetwork
已启动承载网络。
5,启动vpn
23,无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
头疼多年的依赖关系,原来这么可以解决。。。。
把这俩勾上
把用不到的去掉
然后更新
安装就好
然后改bashrc
验证
- #java path
- #export JAVA_HOME=/home/senrsl/java/jdk1.7.0_71
- #export JAVA_HOME=/home/senrsl/java/openjdk7u/build/j2sdk-image
- #export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
- #export JAVA_HOME=/home/senrsl/java/jdk1.6.0_45
- export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
- export JRE_HOME=${JAVA_HOME}/jre
- export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
- export PATH=${JAVA_HOME}/bin:$PATH
oracle的jdk用的好好地为什么要换openjdk,shit!!!
- senrsl@senrsl-T540p:~$ java -version
- java version "1.6.0_45"
- Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
- Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
- senrsl@senrsl-T540p:~$ source ~/.bashrc
- senrsl@senrsl-T540p:~$ java -version
- java version "1.7.0_85"
- OpenJDK Runtime Environment (IcedTea 2.6.1) (7u85-2.6.1-5ubuntu0.14.04.1)
- OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode)
24,搭建android auto模拟器环境
官方介绍地址developer.android.com/training/auto/start/index.html
1)nexus7为手机端,笔记本为车机端;
2)手机端刷6.0镜像,挂vpn并保持全程开启,从play商店下载安装android auto应用;
3)点击标题栏上的文字【 Android Auto】10次,下面会有提示开启开发者模式,然后右边菜单栏Start head unit server.
4)笔记本执行端口转发
5)笔记本启动车机端模拟器脚本
- senrsl@senrsl-T540p:~$ adb forward tcp:5277 tcp:5277
第一次启动此脚本时,nexus7会弹出界面,点击各种ACCEPT,及允许各种授权访问,然后会自动更新google相关服务为最新,更新完成 后,桌面版车机有画面为连接成功。
车机端数据及网络来源于手机端,声音及画面输出于车机端。
此为android auto开发模式
25,明日又莞城
2015年11月24日14:54:19
--
senRsl
2015年10月19日18:11:09
2015年10月19日18:11:09
没有评论 :
发表评论