Workaround for Google Drive application "unsupported" on AMD Mac

Just to share my experience with the "Google Drive for Desktop" app on my AMD Hackintosh.

Configuration

CPU: AMD 5900x CPU
Mac OS: Big Sur 11.x.x with OpenCore
GoogleDrive for Desktop: version 47 (The problem starts when the app supports Apple M1 chips)

Symptom
When Google Drive is installed "successfully", it cannot run. The app Icon has a "/" sign on it. If you try to run it from /Application/Google Drive, it will fail with error:
""google drive" not supported on this Mac"

Root cause
Google Drive installs the ARM (M1) version of the app binaries for AMD CPUs. You can verify this by "Get Info" on the Google Drive application. If It says it's for "apple silicon", it cannot run on an AMD CPU.

In the installer pkg file. Here is the culprit code in Distribution file:

 function is_intel() { return system.sysctl('machdep.cpu.brand_string').toLowerCase().includes('intel'); } function is_arm() { return !is_intel(); } 

The code here says that any CPU that is not Intel is considered ARM (M1). And an ARM version of the app will be installed.

Fix
Step 1: Get the pkg file.
Mount the GoogleDrive.dmg file. Copy "GoogleDrive.pkg" file to a workable path.

Step 2: Unpack the pkg file.
Open Terminal. Enter the path of the pkg file.

pkgutil --expand GoogleDrive.pkg ./working_path 

Step3: Fix the code.
Enter ./working_path. Use any text editor to open the Distribution file. For example
vim ./working_path/Distribution
Find this section:

 function is_intel() { return system.sysctl('machdep.cpu.brand_string').toLowerCase().includes('intel'); } 

Replace it with

function is_intel() { return system.sysctl('machdep.cpu.brand_string').toLowerCase().includes('intel') || system.sysctl('machdep.cpu.brand_string').toLowerCase().includes('amd'); } 

Save the file.

Step 4: Repack the pkg file.

pkgutil --flatten ./working_path GoogleDriveUpdated.pkg 

Step 5: Install this updated pkg file.
Note: there may be additional steps required to enable System Extension files or permissions. Follow the steps at https://support.google.com/drive/answer/7329379#macos&zippy=%2Cuse-google-drive-for-desktop-on-macos-high-sierra-or-newer

Alternatively, you may use this link for GoogleDrive for Desktop v47 (up to date as of 5/16/2021). It's exactly the same output from following the instructions above. I will not update this file for future versions.

Good luck.

submitted by /u/fruitcc
[link] [comments]
Share: