Installing Google Play Service and Google Apps on Nexus AOSP

本文详细介绍了如何在自编译的AOSP系统上安装Google Play服务和其他基本Google应用的方法。教程分为四部分:编译自定义镜像、将自定义镜像刷入Nexus设备、刷入第三方恢复模式及安装Google套件。这些步骤适用于大多数Nexus设备及Android版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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 it working 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: link

Once 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: link

Once 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 default recovery 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: link

The 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

google play service最新版本,基于firebase的sdk,9.2.0.包含了 全部需要的jar,另外还有aar版本 play-services-ads-9.2.0.jar play-services-analytics-9.2.0.jar play-services-analytics-impl-9.2.0.jar play-services-appindexing-9.2.0.jar play-services-appinvite-9.2.0.jar play-services-appstate-8.4.0.jar play-services-auth-9.2.0.jar play-services-auth-base-9.2.0.jar play-services-base-9.2.0.jar play-services-basement-9.2.0.jar play-services-cast-9.2.0.jar play-services-cast-framework-9.2.0.jar play-services-clearcut-9.2.0.jar play-services-contextmanager-9.2.0.jar play-services-drive-9.2.0.jar play-services-fitness-9.2.0.jar play-services-games-9.2.0.jar play-services-gass-9.2.0.jar play-services-gcm-9.2.0.jar play-services-identity-9.2.0.jar play-services-iid-9.2.0.jar play-services-location-9.2.0.jar play-services-maps-9.2.0.jar play-services-measurement-8.4.0.jar play-services-nearby-9.2.0.jar play-services-panorama-9.2.0.jar play-services-places-9.2.0.jar play-services-plus-9.2.0.jar play-services-safetynet-9.2.0.jar play-services-tagmanager-9.2.0.jar play-services-tagmanager-api-9.2.0.jar play-services-tasks-9.2.0.jar play-services-vision-9.2.0.jar play-services-wallet-9.2.0.jar play-services-wearable-9.2.0.jar play-services-ads-lite-9.2.0.jar firebase-analytics-9.2.0.jar firebase-analytics-impl-9.2.0.jar firebase-auth-9.2.0.jar firebase-auth-common-9.2.0.jar firebase-auth-module-9.2.0.jar firebase-common-9.2.0.jar firebase-config-9.2.0.jar firebase-crash-9.2.0.jar firebase-database-9.2.0.jar firebase-database-connection-9.2.0.jar firebase-iid-9.2.0.jar firebase-messaging-9.2.0.jar firebase-storage-9.2.0.jar firebase-storage-common-9.2.0.jar
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值