1. The background
In the process of building iOS environment, some problems and experience are summarized for reference.
2. Developers & Certificates
You must have a development account on iOS whether you are developing, debugging or publishing applications. Registered address :developer.apple.com/
Individual developers
After registering an account, you can debug and develop. For example, a project that you drag off Github and want to compile and run to see what happens
After importing the project, the steps are as follows:
- Automatically manage signing is selected
- Select a Personal Account
- Give your application a name :Bundle ID. Note that this name is unique and you cannot reuse someone else’s BundleID.
Formal development environment
First you need to go to the Apple Developer site and download the certificate and description file.
Certificate application and download can be found here:
IOS certificate (.p12) and description file (.mobileprovision) application
What these things do:
- Profiles
The description file determines whether or not your application can be published. This is the Android equivalent of a signature file. The description files for development/release/enterprise packages are generally different, and you need to apply for more than one when creating a project.
- Certificates (Certificates)
Certificates determine whether you can develop and distribute applications on your MAC.
- Bundle ID
Is the Android package name, equivalent to the identity address in the AppStore. BundleID is bound to Profiles and must correspond.
- Real machine test
If you need to test on a real machine, you must also enter your test machine into equipment management.
To sum up :iOS development, certificate + description file + BundleID + real machine management is indispensable.
3. The Pod
- create
Podfile
File.
Without Pods, there is only one Runner. Xcodeproj file. The example project created with Flutter does this and can also be opened directly. But just as Android development relies on Gladle to import component code, the iOS Podfile is the Android gradle file I usually copy a Podfile directly from the previous project, modify it slightly, and use it as the Pod configuration file for the current project.
pod install
The process of pod Install is the process of installing the dependent libraries. On Android, just do build directly and it will automatically install dependencies, but on iOS, the two steps are separate. Install first, compile later.
- Open the
Runner.xcworkspace
When you open it up, you see that the project has two parts. One is the main project, the other is the dependent Pod library, and you can see the code in the Pod library directly.
Note that if the flutter configuration file changes, the actions to be performed are
flutter pub get
cd ios
pod install
Copy the code
Or something similar to complete the Pods code synchronization.
4. Build & Publish
1. Compile and run
- The default iOS Target for flutter is 8.0. This is the equivalent of the Build Target SDK for Android.
- Check whether debugging /Release/InHourse(enterprise package) configuration information is incorrect
2. An official package is released
The original plan was to use CI to build iOS, but found that the company could not get the machine permission to build the cluster, so it was not possible to install the Flutter environment and use Flutter on the cluster. The current approach is that RD builds manually using Archive itself
- Configure the Archive Config file
Select the configuration you want to package here, just like Android selects Debug/Release/ channel package.
- Perform Archive
After the build is complete, check to see if the information is correct (distinguish enterprise package from AppStore configuration parameters)
- product
The build product,XCode will store it for us, and we can open it directly from Window next time
If it’s an enterprise package build, choose the third.
Then you have to select the certificate again.
3. Release of channel package
After the package is complete, run Export.
Export the file to the corresponding folder and find the. Ipa file
This is the product of need.
Directly in dandelion, drag ipA file into, will automatically generate a TWO-DIMENSIONAL code, easy to scan code installation. Deaily packages can also be built by doing a daily scheduled task on CI and automatically uploading the product through dandelion’s API.
5. To summarize
-
To put it simply, iOS is very strict with developers. Development accounts, profiles, certificates, debug manager,BundleID, plus a fee threshold
-
IOS dependency builds are done with Pod and may not be as smart as Android Gradle. However, considering the intelligence of AndroidStudio, I didn’t make much of a difference in my development efficiency. Instead, I had to use the command line –debug –info to find out where the problem was.
In addition, I think Xcode is better than the directory management structure
XCode hierarchy directory, usually can be directly closed. Most of the time, you don’t have to worry about what’s in the library. You just open it when you need it.
- Application packaging and publishing this, doing it manually in XCode, is really tedious. But if you have a CI and you just take it from the assembly line, that’s not a problem.