Make Android Development in Ubuntu
来源:互联网 发布:资产管理系统源码 编辑:程序博客网 时间:2024/05/19 12:15
In China,for access Google Service,you must have a vpn. Here I use ExpressVPN,it’s installation is very easy,download installation file ending with .deb,then run sudo dpkg -i file.deb.
1.install openjdk
In terminal run
$ java
it’ll info you, java not installed and can be found in below packages.
Then we choose the last one to install
Here , we choose to install last one.
$ sudo apt install openjdk_9_jre_headless
Be careful: when you execute install commend in terminal,then terminal warn like
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
It’s possible you have some software is installing for Ubuntu Software or other terminal.
Then execute
$ javac
just as before,then we execute
$ sudo apt install openjdk-9-jdk
there is a crash, you can repair it as follow:
sudo dpkg --configure -a
sudo dpkg -i --force-overwrite '/var/cache/apt/archives/openjdk-9-jdk_9~b114-0ubuntu1_amd64.deb'
openjdk-9-jdk_9~b114-0ubuntu1_amd64.deb is you downloaded openjdk9 package,it can be some different.
refer :http://askubuntu.com/questions/769467/can-not-install-openjdk-9-jdk-because-it-tries-to-overwrite-file-aready-includ
$ javac
it’s probably OKif not , reboot try again.
You may wonder how about just install openjdk-9-jdk? I don’t try,so I don’t know.
2.Install Android Studio
1.Download Android Studio from developer.android.com,then unpack downloaded zip file like below:
sudo apt-get install unzip
sudo unzip file.zip -d destination_folder
2.launch Android Studio, open a terminal, navigate to the android-studio/bin/ directory, and execute
$ ./studio.sh
Then execute,as Wizard .
Be careful:Required libraries for 64-bit machines,you can install as follow:
At first enable multi-arch support (if not done already):
$ sudo dpkg --add-architecture i386
then
$ sudo apt-get update
$ sudo apt-get install libbz2-1.0:i386
refer from:http://askubuntu.com/questions/637113/unable-to-locate-package-lib32bz2-1-0
IMHO,android government method cannot use.
3.Run Apps on a Hardware Device
Enable USB debug on your device this part is ignored here.
add a udev rules file that contains a USB configuration for each type of device you want to use for development.
$ sudo vi /etc/udev/rules.d/51-android.rules
then add below to new created file:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
In this example, the vendor ID “0bb4” is for HTC. The MODE assignment specifies read/write permissions, and GROUP defines which Unix group owns the device node.
here need to replace with your mobile Phone manufacturers’ code.
You can get it from :https://developer.android.com/studio/run/device.html.
$ sudo chmod a+r /etc/udev/rules.d/51-android.rules
then ,reboot your mobile phone and ubuntu.
refer https://developer.android.com/studio/run/device.html
- Make Android Development in Ubuntu
- Build android development platform in Ubuntu 10.04
- install Android development environment in the Ubuntu
- Build Linux/Android development platform in Ubuntu 10.04
- make & make sdk in Android
- Best practices in Android development
- Best practices in Android development
- Best practices in Android development
- Best practices in Android development
- Ubuntu eclipse Enviroment Android Development
- Setting up Qt Development in Ubuntu 9.04
- Make Ubuntu Stay in Root Mode
- Android development mirror site in China.
- How to make a GroupBox in website development by VS.NET2005
- JBuilder make Ejb development easy
- Ubuntu android编译make adt步骤
- How to make my own local repository in Ubuntu?
- How to make Killer 1535 work in ubuntu
- JavaWeb:HTML
- springMVC构建java web
- Android之WebView 防止调用系统浏览器打开页面
- net-snmp5.7.1.tar.gz安装配置
- 取年月日的字符串方法
- Make Android Development in Ubuntu
- mac 下安装redis
- 洛谷P1150 Peter的烟
- MTK Battery系统
- Linux集群间+SSH免密码登陆
- cocoapods执行pod setup 很慢的解决方式
- Spss K-means聚类分析案例——某移动公司客户细分模型
- SSM搭建-Spring之IOC的XML注入(5)
- Mysql支持的数据类型(总结)