Android 安装 GMS 方法

本文指导如何在Android设备上手动安装Google Mobile Services (GMS),包括下载对应版本包、解压、执行installer.sh脚本,并详细说明了所需的步骤和权限。

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

下载GMS安装包:

https://opengapps.org
根据自己的平台架构,Android版本进行选择;第三个选项只是包含的google应用不同,可以根据自己的需要下载(比如aroma包含所有GMS服务和APpp,Pico只包含核心服务)
此方法需要root权限,只用于测试学习目的
在这里插入图片描述

将installer.sh 和下载解压后的包放在同一目录

在这里插入图片描述

执行installer.sh

$ ./installer.sh open_gapps-arm64-10.0-nano-20210619/

installer.sh :

#!/bin/bash

# sudo apt-get install lzip
c_path=$(dirname "$0")
my_path=$1

core_path=${my_path}Core

gms_path=$c_path/gms

if [ ! -d $gms_path ] ; then
	mkdir $gms_path
fi

for file in ` ls $core_path `
do
	# echo $file
	# 1. unzip *.lz
	if [ -f $core_path/$file ] && [ "${file##*.}"x = "lz"x ] ; then
		# echo $file
		lzip -d $core_path/$file
	fi

	# 2. unzip *.tar
	if [ -f $core_path/$file ] && [ "${file##*.}"x = "tar"x ] ; then
		# echo $file
		tar -xvf $core_path/$file -C $core_path
	fi

	# # 3. move files
	if [ -d $core_path/$file ] ; then
		find $core_path/$file -name "app" -type d -exec cp -rf {} $gms_path \;
		find $core_path/$file -name "priv-app" -type d -exec cp -rf {} $gms_path \;
		find $core_path/$file -name "defaultetc-common" -type d -exec cp -rf {} $gms_path \;
		find $core_path/$file -name "defaultframework-common" -type d -exec cp -rf {} $gms_path \;
		rm -rf $core_path/$file
	fi

done

adb wait-for-device
adb root
adb disable-verity
adb reboot
adb wait-for-device
adb root
adb remount
adb wait-for-device

# adb push $gms_path/priv-app /system/
# adb push $gms_path/app /system/
# adb push $gms_path/etc /system/
# adb push $gms_path/framework /system/

adb push $gms_path/priv-app/GoogleServicesFramework /system/priv-app/
adb push $gms_path/priv-app/Phonesky /system/priv-app/
adb push $gms_path/priv-app/PrebuiltGmsCore /system/priv-app/


adb push $gms_path/defaultetc-common/common/etc/default-permissions /system/etc/
adb push $gms_path/defaultetc-common/common/etc/permissions/. /system/etc/permissions/
adb push $gms_path/defaultetc-common/common/etc/preferred-apps/ /system/etc/
adb push $gms_path/defaultetc-common/common/etc/sysconfig/. /system/etc/sysconfig/

adb push $gms_path/defaultframework-common/common/etc/permissions/. /system/etc/permissions/
adb push $gms_path/defaultframework-common/common/framework/. /system/framework/


echo "push done ,waiting for reboot"

adb reboot
adb wait-for-device
adb root
adb remount



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值