DCloud_App_Array
DCloud_App_Array
  • 发布:2016-10-10 18:31
  • 更新:2024-06-13 19:48
  • 阅读:42616

iOS创建最精简离线打包工程

分类:5+ SDK

ios创建最精简离线打包工程
注意:如果离线打包的是uni-app项目 请点击进入查看如何配置

1 打开Xcode,创建新工程,选择“Single View Application”

2 添加创建工程的名称(注意:最好不要填中文或特殊字符)

3 复制HBuilder-Hello工程的delegate和Controller文件覆盖新创建工程的相应文件

4 拷贝以下文件到新创建工程目录下

iOSSDK/SDK/Bundles/PandoraApi.bundle
iOSSDK/SDK/control.xml
iOSSDK/SDK/Libs/liblibPDRCore.a
iOSSDK/SDK/Libs/libcoreSupport.a
iOSSDK/SDK/Libs/liblibUI.a

5 添加刚才拷贝的文件到工程内

6 拷贝IOS-SDK/SDK/inc目录到新创建工程目录下,并添加到工程内

7 点击Project->TARGETS->Build Settings搜索“Other Linker Flags”,双击搜索到的项双击,在弹出框内添加想“-ObjC”

8 点击Projcet->General->Linked Frameworks and Libraries 添加系统库到工程

系统库
JavaScriptCore.framework
WebKit.framework
CoreTelephony.framework
MobileCoreServices.framework
SystemConfiguration.framework
MediaPlayer.framework
AudioToolbox.framework
Security.framework
QuartzCore.framework
CFNetwork.framework
Foundation.framework
CoreFoundation.framework
CoreGraphics.framework
UIKit.framework
QuickLook.framework
libc++.tbd
libxml2.tbd
libz.tbd
libsqlite3.0.tbd
ImageIO.framework
CoreText.framework
Storekit.framework
UserNotifications 并设置为Optianal

9 点击Project->TARGETS->Build Settings搜索“ARC”,修改"Objective-C Automatic Reference Counting"项的值为"NO", 如果希望使用ARC则需要修改相应的内存管理代码。

10 修改头文件搜索路径

点击Project->TARGETS->Build Settings搜索"Header Search Paths",
双击搜索到的"Header Search Paths"项,将工程目录下的inc目录拖到打开的下拉框

11 修改静态库搜索路径

点击Project->TARGETS->Build Settings搜索"Library Search Paths",
如果"Library Search Paths"项下有值则不需要处理,
如果没有值则双击搜索到的"Library Search Paths"项,将工程目录下的libs目录(静态库所在目录)拖到打开的下拉框

12 修改BitCode

点击Project->TARGETS->Build Settings搜索BitCode
将Enable Bitcode项的值改成 ‘NO’

13 添加Web应用到工程

在工程目录下创建目录”Pandora->apps->[APPID]->www“目录,并将Web应用拷贝到www(小写字母)目录下
APPID为要加入到工程应用mainfest.json文件
添加Pandora目录到工程中

添加后会弹出选择类型框,选择”Create Folder References“

添加后工程内的Pandora目录为蓝色

14 修改control.xml文件

修改control.xml文件的appid节点值为mainfest.json文件的id节点下内容,appver节点内容修改为manifest.json文件的version->name节点下内容

如以上三图红圈标记位置都要一致

15 设置应用的图标

点击project->target->General->App Icons and Launch Images->App Icons Source项右侧小箭头

在新开页面根据提示将对应尺寸的应用图标拖入到虚线框中即可

16 设置应用的splash图片

拷贝HBuider-Hello工程的info.plist文件的UILaunchImages节点到新工程info.plist文件,同时拷贝HBuilder-Hello工程下的splash目录到新工程目录下并将其添加到新工程中
根据图片的尺寸逐个替换splash图片,注意文件名不能修改

17 设置应用显示的应用名

点击project->target->General->Identity->Display Name修改应用的显示名称

18 修改info.plist文件,添加App Transport Security Settings类型为Dictionary,在该项下添加Allow Arbitrary Loads项类型为Boolean,值为YES

IOS 10 需要在info.plist文件中添加隐私权限配置

运行时如果提示“打包时未添加XXX模块”,(非中文提示时需要配置国际化),请参考SDK/Feature-ios.xls文件,查找对应插件名需要引入的5+库文件和系统库文件,添加到工程即可

Android创建最精简离线打包工程

17 关注 分享
Trust zhaomenghuan wenju CFee badfl Runic 3***@qq.com 雨沫 x***@163.com w***@126.com 木子喵 l***@orange100.cn Neil_HL 4***@qq.com skysowe 8***@qq.com 踏江行

要回复文章请先登录注册

骁骑

骁骑

回复 c***@qq.com :
工程需要引入libPDRCore.a到工程里
2017-05-18 12:49
c***@qq.com

c***@qq.com

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_PTDeviceOSInfo", referenced from:
objc-class-ref in ViewController.o
"_OBJC_CLASS_$_PDRCore", referenced from:
objc-class-ref in ViewController.o
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

请问怎么解决@DCloud_SDK_骁骑
2017-05-11 17:25
骁骑

骁骑

回复 3***@qq.com :
好的
2017-05-02 19:32
3***@qq.com

3***@qq.com

回复 骁骑 :
怎么发?是发个帖子放上demo@你吗?
2017-05-02 13:45
骁骑

骁骑

回复 3***@qq.com :
你发一个可重现的Demo出来吧 我看下
2017-05-02 11:42
3***@qq.com

3***@qq.com

回复 骁骑 :
离线打包之后启动页不能手动关闭了以及拍照图片不能显示,在HBuiler里面直接打包确是可以的,请问有解决办法吗?
2017-04-27 18:03
chens

chens

回复 骁骑 :
Showing Recent Issues
Ld /Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Products/Debug-iphonesimulator/chaojiyulebao.app/chaojiyulebao normal x86_64
cd /Users/chen/Documents/chaojiyulebao
export IPHONEOS_DEPLOYMENT_TARGET=10.2
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -L/Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Products/Debug-iphonesimulator -L/Users/chen/Documents/chaojiyulebao/chaojiyulebao/libs -F/Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Products/Debug-iphonesimulator -filelist /Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Intermediates/chaojiyulebao.build/Debug-iphonesimulator/chaojiyulebao.build/Objects-normal/x86_64/chaojiyulebao.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=10.2 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Intermediates/chaojiyulebao.build/Debug-iphonesimulator/chaojiyulebao.build/Objects-normal/x86_64/chaojiyulebao_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -ObjC -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Intermediates/chaojiyulebao.build/Debug-iphonesimulator/chaojiyulebao.build/chaojiyulebao.app.xcent -lsqlite3.0 -lz -lxml2 -lstdc++.6 -framework UIKit -framework CoreGraphics -framework CoreFoundation -framework Foundation -framework CFNetwork -framework QuartzCore -framework Security -framework AudioToolbox -framework MediaPlayer -framework SystemConfiguration -framework MobileCoreServices -framework CoreTelephony -framework WebKit -framework JavaScriptCore -Xlinker -dependency_info -Xlinker /Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Intermediates/chaojiyulebao.build/Debug-iphonesimulator/chaojiyulebao.build/Objects-normal/x86_64/chaojiyulebao_dependency_info.dat -o /Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Products/Debug-iphonesimulator/chaojiyulebao.app/chaojiyulebao

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_PTDeviceOSInfo", referenced from:
objc-class-ref in ViewController.o
"_OBJC_CLASS_$_PDRCore", referenced from:
objc-class-ref in ViewController.o
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

请问是什么原因呢
2017-04-18 15:21
chens

chens

Showing Recent Issues
Ld /Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Products/Debug-iphonesimulator/chaojiyulebao.app/chaojiyulebao normal x86_64
cd /Users/chen/Documents/chaojiyulebao
export IPHONEOS_DEPLOYMENT_TARGET=10.2
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -L/Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Products/Debug-iphonesimulator -L/Users/chen/Documents/chaojiyulebao/chaojiyulebao/libs -F/Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Products/Debug-iphonesimulator -filelist /Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Intermediates/chaojiyulebao.build/Debug-iphonesimulator/chaojiyulebao.build/Objects-normal/x86_64/chaojiyulebao.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=10.2 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Intermediates/chaojiyulebao.build/Debug-iphonesimulator/chaojiyulebao.build/Objects-normal/x86_64/chaojiyulebao_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -ObjC -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Intermediates/chaojiyulebao.build/Debug-iphonesimulator/chaojiyulebao.build/chaojiyulebao.app.xcent -lsqlite3.0 -lz -lxml2 -lstdc++.6 -framework UIKit -framework CoreGraphics -framework CoreFoundation -framework Foundation -framework CFNetwork -framework QuartzCore -framework Security -framework AudioToolbox -framework MediaPlayer -framework SystemConfiguration -framework MobileCoreServices -framework CoreTelephony -framework WebKit -framework JavaScriptCore -Xlinker -dependency_info -Xlinker /Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Intermediates/chaojiyulebao.build/Debug-iphonesimulator/chaojiyulebao.build/Objects-normal/x86_64/chaojiyulebao_dependency_info.dat -o /Users/chen/Library/Developer/Xcode/DerivedData/chaojiyulebao-fjfyphrkmitoecfdtwkyanxprskk/Build/Products/Debug-iphonesimulator/chaojiyulebao.app/chaojiyulebao

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_PTDeviceOSInfo", referenced from:
objc-class-ref in ViewController.o
"_OBJC_CLASS_$_PDRCore", referenced from:
objc-class-ref in ViewController.o
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

请问什么原因
2017-04-18 15:13
骁骑

骁骑

回复 7***@qq.com :
MediaPlayer.framework
AudioToolbox.framework
这两个系统库加上试试
2017-04-13 18:19
7***@qq.com

7***@qq.com

回复 所谓 :
我也是这个错..请问,最后怎么解决的
2017-04-05 10:04