Preparation environment
- iOS development environment, Mac OS, XCode version 7.2 or above;
- Download Hbuilder offline packaged iOS SDK (5+ SDK download).
SDK Directory Description
- Hbuilder-hello: Offline packaging demo application;
- Feature-ios.xls:ios platform each extension Feature API corresponding library file list;
- Readme.txt: Release Notes file.
Note: The Hbuilder runtime Environment-related library files are all included in the Hbuilder-hello demo app
Configuring the compilation Project
- Create a project from the demo app Hbuilder-hello
Unpack the SDK package, copy the demo app Hbuilder-hello (you can rename the directory), go to the directory, double-click the "hbuilder-hello.xcodeproj" file to open the project:
- Configure App Identity (Boundle Identifier)
Select the application engineering root in Project Navigator on the left, select the Hbuilder under targets to open the project properties interface, and under general, modify the value of the identity:
Where bundle identifier is Apple's AppID, must be consistent with the application release is the configuration of the profile associated with the AppID; version is the app version number, which is displayed in the App Store, The recommendation is consistent with the name value under version in Manifest.json, build is the compiled version number, the APP store determines the upgrade usage, and is recommended in accordance with the code value in version Manifest.json.
In the project properties interface, change the value of the bundle display name by switching to the info key:
- Configure app icon and launch interface
To demonstrate that the app has been configured with an icon and launch screen in the project, simply copy the corresponding image to the icon and splash directory in the corresponding project at the specified resolution:
注意:Pandora目录为folder references引入方式,修改后不会自动更新,需要在模拟器或设备删除应用后再重新运行注意:拷贝到Pandora目录的www目录中manifest.json需要删除注释
Open the Pandora-to-apps directory, and modify the following "HelloH5" directory name to apply the ID name in Manifest.json (this is important, otherwise it will not start properly) and copy all app resources to the WWW directory below it:
- Configure app Information
Open the Control.xml file under the project directory and modify the AppID value:
Where the AppID value is the AppID of the Hbuilder application, it must be exactly the same as the ID value in the app Manifest.json; AppVer is the version number of the app, and the upgrade for the app resource must be maintained with version in Manifest.json The name value is exactly the same; the version value is the applied base version number (the value returned by Plus.runtime.innerVersion), and do not modify it arbitrarily.
- Configure the 5+ function module used by your app (optional)
The 5+ API feature module in the demo app that already references Hbuilder all extensions, if not used in the app, removes unused modules in order to reduce the size of the installation package when publishing. Find "Other Linker Flags" in "linking" under the Project Properties interface "Build Settings":
Double-click the list of pop-up values:
Find the "Linkerflags" in the "Feature-ios.xls" file that does not use the corresponding module, and remove it from the list.
If you do not use "Baidu map", you can select "-llibmap", "-lbmapimp", "-lbaidumapapi", through the lower left corner of the list to delete the minus:
- Configure parameters for third-party libraries
If you use a function module that uses a third-party library (such as push, share, speech recognition, statistics), you need to find the "info" value of the corresponding module in the "Feature-ios.xls" file, and in the project properties interface "Info" under "Custom IOS Target Properties "to find the corresponding item configuration:
such as Baidu Map, need to configure in the application of Baidu Cloud platform Appkey, find "Baidu" under the "Appkey", double-click Enter the correct appkey value:
Note: Sina Weibo and share also need to configure the app URL schemes, under the "URL Types" entry separately enter the values on each open platform request:
Configuration Complete Compilation Run
After the application is configured, compile and run the application on the emulator:
Start the emulator and run it correctly after compiling:
Android Platform please refer to Android offline packaging
Copy from HTTP://ASK.DCLOUD.NET.CN/ARTICLE/41
iOS offline packaging