meganz / iOS

MEGA for iOS

Home Page:https://apps.apple.com/app/mega/id706857885?mt=8

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Experience sharing: How to debug Mega iOS app on your own device based on Github repo

pmtao opened this issue · comments

The Mega app is great! This issue covers how to debug and run the Mega iOS app on your own device. Anyone who is interested in customizing their own version of the Mega app can find this helpful.

1. Apple developer program

Firstly, you need an apple developer program, not the free version, but the paid one that include iCloud, push notifications, and other capabilities available only in the paid program.

2. Install Xcode and CMake

  • Install Xcode in your system.
  • Install CMake, and create a symbolic link in folder '/usr/local/bin' after install so that you can run it directly in the Xcode shell:
sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install

3. Clone the repo

Repo link: https://github.com/meganz/iOS

4. Update submodule

  • open .gitmodules file under repo root directory, and change the URL:
  1. Change url for karere submodule, use this one: https://github.com/meganz/MEGAchat.git
  2. Change url for SDK submodule, use this one: https://github.com/meganz/SDK.git
  • run command to update:
git submodule update --init --recursive

5. Download 3rdparty packages

  1. Download the prebuilt third party dependencies from this link: https://mega.nz/file/AENVGYjC#HhUgIOBY69zVZZtOa4e6vdySpHefnUo4GcoQYElmEo4
  2. Uncompress that file and move the folders webrtc , include and lib into iMEGA/Vendor/sdk/bindings/ios/3rdparty.

6. Modify Xcode project

  • Open iMEGA.xcworkspace in Xcode, wait Swift Package to update.
  • Select target MEGA, change Bundle Identifier to your own com.xxx , and choose Automatically manage signing with your own account.
  • Change default App Groups group.mega.ios to your own name group.com.xxx , iCloud Containers make the same change iCloud.com.xxx .
  • Do the same for other targets: MEGAPicker, MEGAPickerFileProvider, MEGAShare, MEGANotifications, MEGAWidgetExtension, MEGAIntent.

7. Modify source code

  • Modify file MEGANotifications.entitlements , delete this line: com.apple.developer.usernotifications.filtering .
  • Modify MEGAConstants.m change value of MEGAGroupIdentifier to your own group id: group.com.xxx .
  • Modify AppGroupContainer.swift change value of identifier to your own group id: group.com.xxx .
  • Modify iMEGA/Extensions/MEGAPickerFileProvider/Info.plist change NSExtensionFileProviderDocumentGroup to your own group id: group.com.xxx .

8. Run the project with real iPhone device but not the simulator

Running in the simulator will crash when app launch.

Also published here