iOS V.S. Android (Engineering Tools & Techniques)
2022, Mar 02
In the previous article, the comparison of language characters between Android & iOS is made. In this article, let’s compare the two tech stacks from the aspect of Engineering Tools & Techniques
. We will go to compare the two platforms from:
- Core Techniques
- Deliverable Standards
- Popular Tools
The word Engineering
here refers to the process of build/test/optimise deliverables such as App/SDK and optionally provide dynamic fixes for those deliverable already running under production environment.
1. Core Techniques
1.1 Compliation Configuration
Android
:- Using gradle as build framework.
- Understanding in Android gradle configuration is a must.
- Any deep customization will require a thorough read on android gradle plugin
iOS
:- The build configuration is done directly on Xcode for most of the time.
- Alternatively, there are py/ruby frameworks allow users to modify the
.xcproj
via script
1.2 Characters
Android
strong dynamic capability due to VM nature, in order to utilise syuch feature, the following technique is commonly adopted:- ClassLoader
- Kotlin/Java Annotation
- Compile Time/Load Time Trasfrom & Byte Instrumentation via tools like Javassist
iOS
demonstrate relatively weak dyanmic capabilities. There are a still options like fishhook
2. Deliverables
2.1 Structure & Format
Android
: both the app and sdk build depends on the android gradle plugin- Apk & AAB for applications, where AAB contains build variants and supports future auto optmisation in play store.
- Aar used for SDKs
iOS
:- Ipa for applications
- .framework (a legacy informal bundle format) and nowadays the
.xcframework
is recommended to provide support for cross iOS/Mac/Watch platforms support. Refer to this
2.2 Resource Management
Android
: there are two resource foldersRes
folder: all resources are put into the res folder, which will be further compiled into R.java andARSC
file, theARSC
provides the compression of all resouce datas and R provide the indexes to locate values in ARSC.- Detailed explanation of ARSC file structure and design.
Assets
folder: folder to hold all customized files which will not be processed during compilation process, they will be inserted directlt into the apk/aab file.
iOS
all resources are put in to.bundle
files, bundle will be put into the eventual ipa file and get loaded by the program.
2.3 Signing
Android
: signings are needed for both SDK and App- Signing mechanism for Android is keeping continiously evovling, currently there are 3 versions of signing solutions available. V1 is the original jar-signer comes with drawbacks of efficiency and security loopholes, and V2/3 are based on utilisation of the ZIP protocol.
- For Apk signing, two keys are needed: upload key and play store app signing keys
- No signing/certs are required for developer to develop and deploy apk in dev phases.
iOS
: signings are only needed for App.- Developer provision profiles are needed to deploy ipa files to iOS devices.
- For iOS developers need to have a clear understanding on concepts like CSR, Certificate, ProvisionProfile. This article provides a perfect explanations.
- Create a cert via CSR to identify the developer
- Create an appId
- Create the provision profile using: - certs in step 1. - entitlements like push/pay/cloud storage - device lists.
3. Popular Tools
3.1 Deploy
Regular Deploy: referring to the release and deploy packages in regular flows, to a repository or app store.
Android
:- App release & preparations, support internal testing of 100 people and closed testing based on email invitation.
- Aar releasae via maven
iOS
:- Similar to Android, refer to iOS’s official app release instruction. After integration with testflight, apple also supports an alpha test with 1-200 people and 10000 people beta testing.
Hotpatch: referring to the release and deploy of a incremental patch to a deliverable on the fly.
Android
:- Pure static dex loading solution, requres app reboot.
- AOP based runtime method invocation proxy + dex loading. Like the solution proposed by Meituan
iOS
: no main stream commonly used Hotpatch solution in the community. (Except for hybrid apps.)
3.2 Performance Analysis
Android
:- using AS profiler, it integrates all the legacy tools and support both JVM and C native profiling.
iOS
:- xcode instrument provide all the support iOS developer needs ~.
3.3 Test Automation
Android
:- Unit Test: JUnit as basic framework
- Robolectric: Context stubing
- Mockito: API/Data mocking
- Slightly grammar sugars, previouslt I summarized another article regarding it
- UI Automation: use Appium and it is currently most well maintained.
- Inside it is using UIAutomator
iOS
:- Using XCTest for Unit testing
- Using XCUITest for UI testing.
- MockingBird: provide statically protocol based mocking.
- For UI Automation test, use Appium too.
3.3 CI/CD
- Both
Android
&iOS
:- For pipelines use Jenkins(usually in corporations), outside company there are wide range choices such as CirleCI.
- For continious delivery utility, fastlane supports both Android and iOS to:
- auto increment version numbers/ zip and upload files
- collect other app materials needed for publish such as screenshot.