Installing Google Play Service and Google Apps on Nexus AOSP
2016-08-04 17:29
417 查看
Installing Google Play Service and Google Apps on Nexus AOSP
I figured out how to get Google Play Service and all the basic Google apps onto a custom compiled AOSP image. It's kind of tricky, so I'll outline what I learned here. I specifically got itworking on a Nexus 5 device using a modified version of Android 5.0.2, but these steps should hopefully work for all Nexus devices and most Android version. This tutorial is broken up into 4 parts:
Part 1: Compiling a Custom Image
First, make sure you've downloaded the vendor drivers for your device: linkOnce you've downloaded the appropriate files, unzip them. You should now have a bunch of script files. Place these script files in the root directory of your AOSP repository and run them.
Next, make sure you've loaded your sources and you're in the correct lunch for your device (for Nexus 5, this is hammerhead aka 20):
$> source build/envsetup.sh
$> lunch 20
If this is your first time doing a make with the vendor drivers, you need to clobber to make sure the drivers are compiled into the ROM:
$> make clobber
After that, make your ROM:
$> make
Part 2: Flashing Custom Image to a Nexus Device
First, reboot your device into fastboot. The hardware button sequence for your device can be found here: linkOnce in fastboot, ensure that your bootloader is unlocked. You can lookup how to do this online.
After that, check that your computer can detect your device. You should see it when you run the following command:
$> fastboot devices
If you can't see it, check your USB drivers and make sure you have Google's Nexus USB drivers if you're using a Nexus device.
Finally, flash the device:
$> fastboot -w flashall
Part 3: Flashing Recovery
At this point, you've compiled a custom image and flashed it to your device. The next goal is to install the standard Google apps (GPS, Google Play, Gmail, etc.). Unfortunately, the defaultrecovery doesn't work well with rooted devices. So before we can do that, we need to install a 3rd-party recovery.
First, reboot the device into fastboot. This can be done via adb:
$> adb reboot bootloader
Once in fastboot, we can flash the recovery partition with our custom recovery. I recommend twrp which can be found here: https://twrp.me/Devices/ For Nexus 5, this version of twrp will work: link
$> fastboot flash recovery twrp-2.8.7.1-hammerhead.img
After that, reboot the device:
$> fastboot reboot
Part 4: Install Gapps
First, push a gapps archive onto your sd card. This can be downloaded from cyanogen's website: linkThe website only shows which gapps corresponds to which cyanogenmod version and not the equivalent AOSP version. From my experiences, I believe this much to be true:
Android 5.1.0 <=> CM 12.1
Android 5.0.0, 5.0.1, 5.0.2 <=> CM 12
If you are using a different version of AOSP, you'll have to experiment and find the right version on your own. Note, you can always do a factory reset from recovery to remove gapps and then
install another version.
Once you've downloaded a version of gapps, push it to the sd card:
$> adb push gapps.zip /sdcard/
Once the zip is written to the sd card, reboot into recovery:
$> adb reboot recovery
Once in the Recovery, select install from zip and select your zip. After the installation is complete, select the wipe button at the bottom of the screen and then reboot the device. If everything
worked correctly, you should be prompted with the Welcome screen which will ask you to configure your device. If you do not get the Welcome screen, then you either didn't install the correct version of gapps or you forgot to wipe something.
转自:https://carteryagemann.com/blog/090315-play-service-on-aosp.amp.html
相关文章推荐
- idp sp sso---SAML Single Sign-On (SSO) Service for Google Apps
- Genymotion 2.6.0 with Google Service and ARM apps
- idp sp sso---SAML Single Sign-On (SSO) Service for Google Apps
- android app rate on google play and amazon
- Experience installing Hbase 0.20.0 Cluster on Ubuntu 9.04 and EC2
- Installing SharePoint 2010 on Windows Server 2008 R2 – which server roles and features do I need?
- My thoughts on AppSecDC 2009 and why you should “OWASP”
- Installing and using Net-SNMP On Linux
- MonoDevelop 1.0 on CentOS 5 and Fedora: Compiling and Installing
- Installing Hudson on Debian and Ubuntu
- Write Auto-Updating Apps with .NET and the Background Intelligent Transfer Service API
- Installing JBoss jBPM 3.2.2 on Apache Tomcat 5.5 and MySQL
- Write Auto-Updating Apps with .NET and the Background Intelligent Transfer Service API
- How to install Google Apps (GApps) on your Android Device / Phone
- Web Camps Belgium: Hands-on HTML5 and Web Apps announced
- Installing SharePoint 2010 on Windows Server 2008 R2 – which server roles and features do I need?
- Get to the Top on Google: Tips and Techniques to Get Your Site to the Top of the Search Engine Ranki
- Installing and using Net-SNMP On Linux
- Building and Installing ACE on Win32 with MinGW/ MSYS
- Write Auto-Updating Apps with .NET and the Background Intelligent Transfer Service API