iOS编译openssl实践

简介: 之前建设的跨平台全链路智能语音交互系统一直只跑在Android系统(主要是Iot设备),没有iOS业务场景,最近经过不断的努力,终于要把这个能力推广到B端APP,面向B端用户,这个时候就有了iOS的述求,毕竟从能力建设之初就吹出去了,系统是跨平台的,这个时候不能掉链子。

image.png


1. 背景


之前建设的跨平台全链路智能语音交互系统一直只跑在Android系统(主要是Iot设备),没有iOS业务场景,最近经过不断的努力,终于要把这个能力推广到B端APP,面向B端用户,这个时候就有了iOS的述求,毕竟从能力建设之初就吹出去了,系统是跨平台的,这个时候不能掉链子。


虽然全链路语音交互SDK已经跑在Andorid、Ubuntu、Mac上跑通,但是在iOS设备上心里还是挺虚。全链路语音交互SDK依赖了curl来直线HTTP2协议的传输,而curl又依赖了nghttp2与openssl,从最底层依赖出发本文先编译openssl库。


2. 编译过程


2.1 寻找工具


作为一个Android开发,对iOS的编译器和平台没有那么熟悉,本来想着直接找现成的工具来编译,github上一搜找到了 github.com/jasonacox/B… 这个工具,它可以运行一个脚本把openssl + nghttp2 + curl 都编出来,一下感觉可以节省很多时间。 这个工具默认支持的版本是:


  1. OPENSSL : 1.1.1l
  2. LIBCURL :7.80.0
  3. NGHTTP2 :1.46.0


全链路语音SDK依赖的版本为:


  1. OPENSSL : 1.1.0h
  2. LIBCURL:7.61.0
  3. NGHTTP2:1.32.0


版本都比工具里面默认的版本低些,为了减少库版本的影响,抱着侥幸心理编译直接替换成自己的版本开始编译,脚本给了警告:


** WARNING: This build script has not been tested with 1.1.0  **


而且最终编译失败了,为了快速验证后面流程,将openssl版本先修改为1.1.1l,结果出奇的顺利,编译过程没有再报任何错,只是整个编译过程花费时间有点长。


有了编译完的静态库,可以开始编译全链路语音交互SDK库了,但是编译到35%,连接静态库时报错了:


[ 35%] Linking CXX shared library libAVSCommon.dylib
Undefined symbols for architecture armv7:
  "_ASN1_STRING_free", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_ASN1_STRING_get0_data", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_ASN1_STRING_length", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_ASN1_STRING_new", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_ASN1_STRING_print", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_ASN1_STRING_to_UTF8", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_ASN1_STRING_type", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_ASN1_TIME_print", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_BIO_ctrl", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _x509_name_oneline in libcurl.a(libcurl_la-openssl.o)
      _pubkey_show in libcurl.a(libcurl_la-openssl.o)
  "_BIO_f_ssl", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_BIO_free", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _x509_name_oneline in libcurl.a(libcurl_la-openssl.o)
  "_BIO_new", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _x509_name_oneline in libcurl.a(libcurl_la-openssl.o)
  "_BIO_printf", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_BIO_puts", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_BIO_s_file", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_BIO_s_mem", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _x509_name_oneline in libcurl.a(libcurl_la-openssl.o)
  "_BN_print", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _pubkey_show in libcurl.a(libcurl_la-openssl.o)
  "_CONF_modules_load_file", referenced from:
      _Curl_ossl_init in libcurl.a(libcurl_la-openssl.o)
  "_CRYPTO_free", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_CRYPTO_malloc", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_DES_ecb_encrypt", referenced from:
      _Curl_ntlm_core_lm_resp in libcurl.a(libcurl_la-curl_ntlm_core.o)
      _Curl_ntlm_core_mk_lm_hash in libcurl.a(libcurl_la-curl_ntlm_core.o)
  "_DES_set_key", referenced from:
      _setup_des_key in libcurl.a(libcurl_la-curl_ntlm_core.o)
  "_DES_set_odd_parity", referenced from:
      _setup_des_key in libcurl.a(libcurl_la-curl_ntlm_core.o)
  "_DH_get0_key", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_DH_get0_pqg", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_DSA_get0_key", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_DSA_get0_pqg", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_ENGINE_by_id", referenced from:
      _Curl_ossl_set_engine in libcurl.a(libcurl_la-openssl.o)
  "_ENGINE_ctrl", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_ENGINE_ctrl_cmd", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_ENGINE_finish", referenced from:
      _Curl_ossl_close_all in libcurl.a(libcurl_la-openssl.o)
      _Curl_ossl_set_engine in libcurl.a(libcurl_la-openssl.o)
  "_ENGINE_free", referenced from:
      _Curl_ossl_close_all in libcurl.a(libcurl_la-openssl.o)
      _Curl_ossl_set_engine in libcurl.a(libcurl_la-openssl.o)
  "_ENGINE_get_first", referenced from:
      _Curl_ossl_engines_list in libcurl.a(libcurl_la-openssl.o)
  "_ENGINE_get_id", referenced from:
      _Curl_ossl_set_engine_default in libcurl.a(libcurl_la-openssl.o)
      _Curl_ossl_engines_list in libcurl.a(libcurl_la-openssl.o)
  "_ENGINE_get_next", referenced from:
      _Curl_ossl_engines_list in libcurl.a(libcurl_la-openssl.o)
  "_ENGINE_init", referenced from:
      _Curl_ossl_set_engine in libcurl.a(libcurl_la-openssl.o)
  "_ENGINE_load_private_key", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_ENGINE_set_default", referenced from:
      _Curl_ossl_set_engine_default in libcurl.a(libcurl_la-openssl.o)
  "_ERR_clear_error", referenced from:
      _Curl_ossl_shutdown in libcurl.a(libcurl_la-openssl.o)
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _ossl_recv in libcurl.a(libcurl_la-openssl.o)
      _ossl_send in libcurl.a(libcurl_la-openssl.o)
  "_ERR_error_string_n", referenced from:
      _Curl_ossl_shutdown in libcurl.a(libcurl_la-openssl.o)
      _Curl_ossl_set_engine in libcurl.a(libcurl_la-openssl.o)
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _ossl_recv in libcurl.a(libcurl_la-openssl.o)
      _ossl_send in libcurl.a(libcurl_la-openssl.o)
  "_ERR_get_error", referenced from:
      _Curl_ossl_shutdown in libcurl.a(libcurl_la-openssl.o)
      _Curl_ossl_set_engine in libcurl.a(libcurl_la-openssl.o)
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _ossl_recv in libcurl.a(libcurl_la-openssl.o)
      _ossl_send in libcurl.a(libcurl_la-openssl.o)
  "_ERR_peek_error", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_EVP_DigestFinal_ex", referenced from:
      _Curl_ossl_md5sum in libcurl.a(libcurl_la-openssl.o)
      _Curl_ossl_sha256sum in libcurl.a(libcurl_la-openssl.o)
  "_EVP_DigestInit_ex", referenced from:
      _Curl_ossl_md5sum in libcurl.a(libcurl_la-openssl.o)
      _Curl_ossl_sha256sum in libcurl.a(libcurl_la-openssl.o)
  "_EVP_DigestUpdate", referenced from:
      _Curl_ossl_md5sum in libcurl.a(libcurl_la-openssl.o)
      _Curl_ossl_sha256sum in libcurl.a(libcurl_la-openssl.o)
  "_EVP_MD_CTX_free", referenced from:
      _Curl_ossl_md5sum in libcurl.a(libcurl_la-openssl.o)
      _Curl_ossl_sha256sum in libcurl.a(libcurl_la-openssl.o)
  "_EVP_MD_CTX_new", referenced from:
      _Curl_ossl_md5sum in libcurl.a(libcurl_la-openssl.o)
      _Curl_ossl_sha256sum in libcurl.a(libcurl_la-openssl.o)
  "_EVP_PKEY_copy_parameters", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_EVP_PKEY_free", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_EVP_PKEY_get0_DH", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_EVP_PKEY_get0_DSA", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_EVP_PKEY_get0_RSA", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_EVP_PKEY_get1_RSA", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_EVP_PKEY_id", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_EVP_md5", referenced from:
      _Curl_ossl_md5sum in libcurl.a(libcurl_la-openssl.o)
  "_EVP_sha256", referenced from:
      _Curl_ossl_sha256sum in libcurl.a(libcurl_la-openssl.o)
  "_GENERAL_NAMES_free", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_MD4_Final", referenced from:
      _Curl_ntlm_core_mk_nt_hash in libcurl.a(libcurl_la-curl_ntlm_core.o)
  "_MD4_Init", referenced from:
      _Curl_ntlm_core_mk_nt_hash in libcurl.a(libcurl_la-curl_ntlm_core.o)
  "_MD4_Update", referenced from:
      _Curl_ntlm_core_mk_nt_hash in libcurl.a(libcurl_la-curl_ntlm_core.o)
  "_MD5_Final", referenced from:
      _Curl_md5it in libcurl.a(libcurl_la-md5.o)
      _Curl_HMAC_MD5 in libcurl.a(libcurl_la-md5.o)
      _Curl_DIGEST_MD5 in libcurl.a(libcurl_la-md5.o)
  "_MD5_Init", referenced from:
      _Curl_md5it in libcurl.a(libcurl_la-md5.o)
      _Curl_HMAC_MD5 in libcurl.a(libcurl_la-md5.o)
      _Curl_DIGEST_MD5 in libcurl.a(libcurl_la-md5.o)
  "_MD5_Update", referenced from:
      _Curl_md5it in libcurl.a(libcurl_la-md5.o)
      _Curl_HMAC_MD5 in libcurl.a(libcurl_la-md5.o)
      _Curl_DIGEST_MD5 in libcurl.a(libcurl_la-md5.o)
  "_OCSP_BASICRESP_free", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OCSP_RESPONSE_free", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OCSP_basic_verify", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OCSP_cert_status_str", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OCSP_check_validity", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OCSP_crl_reason_str", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OCSP_resp_count", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OCSP_resp_get0", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OCSP_response_get1_basic", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OCSP_response_status", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OCSP_response_status_str", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OCSP_single_get0_status", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OPENSSL_load_builtin_modules", referenced from:
      _Curl_ossl_init in libcurl.a(libcurl_la-openssl.o)
  "_OPENSSL_sk_num", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OPENSSL_sk_pop", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OPENSSL_sk_pop_free", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OPENSSL_sk_value", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_OpenSSL_version_num", referenced from:
      _Curl_ossl_version in libcurl.a(libcurl_la-openssl.o)
  "_PEM_read_bio_X509", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_PEM_write_bio_X509", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_PKCS12_PBE_add", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_PKCS12_free", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_PKCS12_parse", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_RAND_add", referenced from:
      _Curl_ossl_seed in libcurl.a(libcurl_la-openssl.o)
  "_RAND_bytes", referenced from:
      _Curl_ossl_random in libcurl.a(libcurl_la-openssl.o)
  "_RAND_file_name", referenced from:
      _Curl_ossl_seed in libcurl.a(libcurl_la-openssl.o)
  "_RAND_load_file", referenced from:
      _Curl_ossl_seed in libcurl.a(libcurl_la-openssl.o)
  "_RAND_status", referenced from:
      _Curl_ossl_random in libcurl.a(libcurl_la-openssl.o)
      _Curl_ossl_seed in libcurl.a(libcurl_la-openssl.o)
  "_RSA_flags", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_RSA_free", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_RSA_get0_key", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SHA256_Final", referenced from:
      _Curl_sha256it in libcurl.a(libcurl_la-sha256.o)
  "_SHA256_Init", referenced from:
      _Curl_sha256it in libcurl.a(libcurl_la-sha256.o)
  "_SHA256_Update", referenced from:
      _Curl_sha256it in libcurl.a(libcurl_la-sha256.o)
  "_SSL_CIPHER_get_name", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_add_client_CA", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_check_private_key", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_ctrl", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_free", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _ossl_close in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_get_cert_store", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_load_verify_locations", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_new", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_set_alpn_protos", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_set_cipher_list", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_set_default_passwd_cb", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_set_default_passwd_cb_userdata", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_set_msg_callback", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_set_next_proto_select_cb", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_set_options", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_set_srp_password", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_set_srp_username", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_set_verify", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_use_PrivateKey", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_use_PrivateKey_file", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_use_certificate", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_use_certificate_chain_file", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_CTX_use_certificate_file", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_SESSION_free", referenced from:
      _Curl_ossl_session_free in libcurl.a(libcurl_la-openssl.o)
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_SESSION_get_master_key", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_connect", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_ctrl", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_free", referenced from:
      _Curl_ossl_shutdown in libcurl.a(libcurl_la-openssl.o)
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _ossl_close in libcurl.a(libcurl_la-openssl.o)
  "_SSL_get0_alpn_selected", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_get1_session", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_get_certificate", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_get_client_random", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_get_current_cipher", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_get_error", referenced from:
      _Curl_ossl_shutdown in libcurl.a(libcurl_la-openssl.o)
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _ossl_recv in libcurl.a(libcurl_la-openssl.o)
      _ossl_send in libcurl.a(libcurl_la-openssl.o)
  "_SSL_get_peer_cert_chain", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_get_peer_certificate", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_get_privatekey", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_get_session", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_get_shutdown", referenced from:
      _Curl_ossl_shutdown in libcurl.a(libcurl_la-openssl.o)
  "_SSL_get_verify_result", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_new", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_pending", referenced from:
      _Curl_ossl_data_pending in libcurl.a(libcurl_la-openssl.o)
  "_SSL_read", referenced from:
      _Curl_ossl_shutdown in libcurl.a(libcurl_la-openssl.o)
      _ossl_recv in libcurl.a(libcurl_la-openssl.o)
  "_SSL_set_bio", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_set_connect_state", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _ossl_close in libcurl.a(libcurl_la-openssl.o)
  "_SSL_set_fd", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_set_session", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_shutdown", referenced from:
      _Curl_ossl_shutdown in libcurl.a(libcurl_la-openssl.o)
      _ossl_close in libcurl.a(libcurl_la-openssl.o)
  "_SSL_version", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_write", referenced from:
      _ossl_send in libcurl.a(libcurl_la-openssl.o)
  "_TLS_client_method", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_UI_OpenSSL", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _ssl_ui_reader in libcurl.a(libcurl_la-openssl.o)
      _ssl_ui_writer in libcurl.a(libcurl_la-openssl.o)
  "_UI_create_method", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_UI_destroy_method", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_UI_get0_user_data", referenced from:
      _ssl_ui_reader in libcurl.a(libcurl_la-openssl.o)
      _ssl_ui_writer in libcurl.a(libcurl_la-openssl.o)
  "_UI_get_input_flags", referenced from:
      _ssl_ui_reader in libcurl.a(libcurl_la-openssl.o)
      _ssl_ui_writer in libcurl.a(libcurl_la-openssl.o)
  "_UI_get_string_type", referenced from:
      _ssl_ui_reader in libcurl.a(libcurl_la-openssl.o)
      _ssl_ui_writer in libcurl.a(libcurl_la-openssl.o)
  "_UI_method_get_closer", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_UI_method_get_opener", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_UI_method_get_reader", referenced from:
      _ssl_ui_reader in libcurl.a(libcurl_la-openssl.o)
  "_UI_method_get_writer", referenced from:
      _ssl_ui_writer in libcurl.a(libcurl_la-openssl.o)
  "_UI_method_set_closer", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_UI_method_set_opener", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_UI_method_set_reader", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_UI_method_set_writer", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_UI_set_result", referenced from:
      _ssl_ui_reader in libcurl.a(libcurl_la-openssl.o)
  "_X509V3_EXT_print", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_EXTENSION_get_data", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_EXTENSION_get_object", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_LOOKUP_file", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_NAME_ENTRY_get_data", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_NAME_get_entry", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_NAME_get_index_by_NID", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_NAME_print_ex", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _x509_name_oneline in libcurl.a(libcurl_la-openssl.o)
  "_X509_STORE_add_lookup", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_STORE_set_flags", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_check_issued", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_free", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_get0_extensions", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_get0_notAfter", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_get0_notBefore", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_get0_signature", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_get_X509_PUBKEY", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_get_ext_d2i", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_get_issuer_name", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_get_pubkey", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_get_serialNumber", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_get_subject_name", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_get_version", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_load_crl_file", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_signature_print", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_X509_verify_cert_error_string", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_d2i_OCSP_RESPONSE", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_d2i_PKCS12_bio", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_i2a_ASN1_OBJECT", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_i2d_X509_PUBKEY", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_i2t_ASN1_OBJECT", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_inflate", referenced from:
      _inflate_stream in libcurl.a(libcurl_la-content_encoding.o)
  "_inflateEnd", referenced from:
      _inflate_stream in libcurl.a(libcurl_la-content_encoding.o)
      _exit_zlib in libcurl.a(libcurl_la-content_encoding.o)
  "_inflateInit2_", referenced from:
      _inflate_stream in libcurl.a(libcurl_la-content_encoding.o)
      _gzip_init_writer in libcurl.a(libcurl_la-content_encoding.o)
  "_inflateInit_", referenced from:
      _deflate_init_writer in libcurl.a(libcurl_la-content_encoding.o)
  "_nghttp2_http2_strerror", referenced from:
      _Curl_http2_strerror in libcurl.a(libcurl_la-http2.o)
      _http2_handle_stream_close in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_is_fatal", referenced from:
      _on_frame_recv in libcurl.a(libcurl_la-http2.o)
      _Curl_http2_switched in libcurl.a(libcurl_la-http2.o)
      _http2_recv in libcurl.a(libcurl_la-http2.o)
      _http2_send in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_pack_settings_payload", referenced from:
      _Curl_http2_request_upgrade in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_priority_spec_init", referenced from:
      _h2_pri_spec in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_callbacks_del", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_callbacks_new", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_callbacks_set_before_frame_send_callback", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_callbacks_set_error_callback", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_callbacks_set_on_begin_headers_callback", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_callbacks_set_on_data_chunk_recv_callback", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_callbacks_set_on_frame_not_send_callback", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_callbacks_set_on_frame_recv_callback", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_callbacks_set_on_frame_send_callback", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_callbacks_set_on_header_callback", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_callbacks_set_on_invalid_frame_recv_callback", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_callbacks_set_on_stream_close_callback", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_callbacks_set_send_callback", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_client_new", referenced from:
      _Curl_http2_init in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_del", referenced from:
      _http2_disconnect in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_get_remote_settings", referenced from:
      _on_frame_recv in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_get_stream_user_data", referenced from:
      _on_frame_recv in libcurl.a(libcurl_la-http2.o)
      _on_invalid_frame_recv in libcurl.a(libcurl_la-http2.o)
      _on_data_chunk_recv in libcurl.a(libcurl_la-http2.o)
      _before_frame_send in libcurl.a(libcurl_la-http2.o)
      _on_frame_send in libcurl.a(libcurl_la-http2.o)
      _on_frame_not_send in libcurl.a(libcurl_la-http2.o)
      _on_stream_close in libcurl.a(libcurl_la-http2.o)
      ...
  "_nghttp2_session_mem_recv", referenced from:
      _h2_process_pending_input in libcurl.a(libcurl_la-http2.o)
      _Curl_http2_switched in libcurl.a(libcurl_la-http2.o)
      _http2_recv in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_resume_data", referenced from:
      _Curl_http2_done_sending in libcurl.a(libcurl_la-http2.o)
      _http2_send in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_send", referenced from:
      _http2_send in libcurl.a(libcurl_la-http2.o)
      _h2_session_send in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_set_local_window_size", referenced from:
      _Curl_http2_switched in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_set_stream_user_data", referenced from:
      _Curl_http2_done in libcurl.a(libcurl_la-http2.o)
      _on_frame_recv in libcurl.a(libcurl_la-http2.o)
      _on_stream_close in libcurl.a(libcurl_la-http2.o)
      _Curl_http2_switched in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_upgrade", referenced from:
      _Curl_http2_switched in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_want_read", referenced from:
      _should_close_session in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_session_want_write", referenced from:
      _should_close_session in libcurl.a(libcurl_la-http2.o)
      _http2_getsock in libcurl.a(libcurl_la-http2.o)
      _http2_perform_getsock in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_strerror", referenced from:
      _h2_process_pending_input in libcurl.a(libcurl_la-http2.o)
      _Curl_http2_switched in libcurl.a(libcurl_la-http2.o)
      _http2_recv in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_submit_priority", referenced from:
      _h2_session_send in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_submit_request", referenced from:
      _http2_send in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_submit_rst_stream", referenced from:
      _Curl_http2_done in libcurl.a(libcurl_la-http2.o)
      _on_frame_recv in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_submit_settings", referenced from:
      _Curl_http2_switched in libcurl.a(libcurl_la-http2.o)
  "_nghttp2_version", referenced from:
      _Curl_http2_ver in libcurl.a(libcurl_la-http2.o)
  "_zlibVersion", referenced from:
      _curl_version in libcurl.a(libcurl_la-version.o)
      _curl_version_info in libcurl.a(libcurl_la-version.o)
      _gzip_init_writer in libcurl.a(libcurl_la-content_encoding.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)


编译完的curl库中找不到我们依赖的openssl方法,在openssl 1.1.1l中果然搜不到这些方法,没办法,还得改回1.1.0h。


2.2 openssl configure配置脚本


现成的工具用不了了,只好自己去研究openssl的编译文档,找到了官网文档:wiki.openssl.org/index.php/C…


2.2.1 32-bit


OpenSSL 1.1.0及以上版本,32-bit iOS 跨平台编译器 uses the ios-cross 作为目标:


$ export CC=clang;
$ export CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
$ export CROSS_SDK=iPhoneOS.sdk
$ export PATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH"
$ ./Configure ios-cross no-shared no-dso no-hw no-engine --prefix=/usr/local/openssl-ios
Configuring OpenSSL version 1.1.1-dev (0x10101000L)
    no-afalgeng     [forced]   OPENSSL_NO_AFALGENG
    no-asan         [default]  OPENSSL_NO_ASAN
    no-dso          [option]
    no-dynamic-engine [forced]
    ...
    no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS
    no-zlib         [default]
    no-zlib-dynamic [default]
Configuring for ios-cross
PERL          =perl
PERLVERSION   =5.16.2 for darwin-thread-multi-2level
HASHBANGPERL  =/usr/bin/env perl
CC            =clang
CFLAG         =-O3 -D_REENTRANT -arch armv7 -mios-version-min=6.0.0 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common
CXX           =c++
CXXFLAG       =-O3 -D_REENTRANT -arch armv7 -mios-version-min=6.0.0 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common
DEFINES       =NDEBUG OPENSSL_THREADS OPENSSL_NO_DYNAMIC_ENGINE OPENSSL_PIC OPENSSL_BN_ASM_MONT OPENSSL_BN_ASM_GF2m SHA1_ASM SHA256_ASM SHA512_ASM AES_ASM BSAES_ASM GHASH_ASM ECP_NISTZ256_ASM POLY1305_ASM
...


OpenSSL 1.0.2及以下,使用iphoneos-cross作为目标:


$ export CC=clang;
$ export CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
$ export CROSS_SDK=iPhoneOS.sdk
$ export PATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH"
$ ./Configure iphoneos-cross no-shared no-dso no-hw no-engine --prefix=/usr/local/openssl-ios
Configuring for iphoneos-cross
    no-dso          [option]
    no-engine       [option]   OPENSSL_NO_ENGINE (skip dir)
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)
    no-hw           [option]   OPENSSL_NO_HW
    ...
    no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS (skip dir)
    no-zlib         [default]
    no-zlib-dynamic [default]
IsMK1MF=0
CC            =clang
CFLAG         =-DOPENSSL_THREADS -D_REENTRANT -O3 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fomit-frame-pointer -fno-common
...


2.2.2 64bit


OpenSSL 1.1.0及以上版本跨平台编译器使用ios64-cross作为目标:


$ export CC=clang;
$ export CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
$ export CROSS_SDK=iPhoneOS.sdk
$ export PATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH"
$ ./Configure ios64-cross no-shared no-dso no-hw no-engine --prefix=/usr/local/openssl-ios64
Configuring OpenSSL version 1.1.1-dev (0x10101000L)
    no-afalgeng     [forced]   OPENSSL_NO_AFALGENG
    no-asan         [default]  OPENSSL_NO_ASAN
    no-dso          [option]
    no-dynamic-engine [forced]
    ...
    no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS
    no-zlib         [default]
    no-zlib-dynamic [default]
Configuring for ios64-cross
PERL          =perl
PERLVERSION   =5.16.2 for darwin-thread-multi-2level
HASHBANGPERL  =/usr/bin/env perl
CC            =clang
CFLAG         =-O3 -D_REENTRANT -arch arm64 -mios-version-min=7.0.0 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common
CXX           =c++
CXXFLAG       =-O3 -D_REENTRANT -arch arm64 -mios-version-min=7.0.0 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common
DEFINES       =NDEBUG OPENSSL_THREADS OPENSSL_NO_DYNAMIC_ENGINE OPENSSL_PIC OPENSSL_BN_ASM_MONT SHA1_ASM SHA256_ASM SHA512_ASM VPAES_ASM ECP_NISTZ256_ASM POLY1305_ASM
...


1.0.2及以下版本不支持64位。


2.3 target说明


像 ios64-cross 和 ios-cross 这些taget是在哪定义使用呢? 以1.1.0h为例,在源码中Configurations下可以看到:


10-main.conf
50-djgpp.conf
50-haiku.conf
50-masm.conf
90-team.conf
INTERNALS.Configure
README


几个conf文件,我们可以在10-main.conf中看到这些target的定义:


"iphoneos-cross" => {
        inherit_from     => [ "darwin-common" ],
        cflags           => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
        sys_id           => "iOS",
    },
    "ios-cross" => {
        inherit_from     => [ "darwin-common", asm("armv4_asm") ],
        # It should be possible to go below iOS 6 and even add -arch armv6,
        # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
        # at this point.
        cflags           => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
        sys_id           => "iOS",
        perlasm_scheme   => "ios32",
    },
    "ios64-cross" => {
        inherit_from     => [ "darwin-common", asm("aarch64_asm") ],
        cflags           => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
        sys_id           => "iOS",
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
        perlasm_scheme   => "ios64",
    },


其他具体参数配置可以参考Configurations下的README,根据说明我们可以找到对应的各种配置参数说明。


2.4 合并静态库


通过一系列修改终于成功编译除了openssl静态库,iOS 设备的CPU架构有两种模拟器和真机 在模拟器上支持:


  1. iPhone4s-5:  i386 架构
  2. iPhone5s-8 Plus: x86_64 架构


在真机设备上支持:


  1. armv6: iPhone、iPhone 2、iPhone 3G、iPod Touch(第一代)、iPod Touch(第二代)
  2. armv7: iPhone 3Gs、iPhone 4、iPhone 4s、iPad、iPad 2
  3. armv7s: iPhone 5、iPhone 5c (静态库只要支持了armv7,就可以在armv7s的架构上运行)
  4. arm64: iPhone 5s、iPhone 6、iPhone 6 Plus、iPhone 6s、iPhone 6s Plus、iPad Air、iPad Air2、iPad mini2、iPad mini3


我们要将多个架构库合并成一个,这时又出错了:


have the same architectures (x86_64) and can't be in the same fat output file


先去了解一下lipo用法:


lipo是管理Fat File的工具, 可以查看cpu架构, 提取特定架构,整合和拆分库文件。


  • lipo -info xxxx.framework/xxxx或/xxxx.a   查看信息,支持的cpu架构列表
  • lipo -create xxxx   xxxx  -output xxx    整合成Fat文件
  • lipo xxxx -thin cpu(armv7/arm64等)  -output  xxx  提取特定的cpu架构的thin文件
  • lipo -remove cpu(armv7/arm64等) xxxx -output  xxxx  移除掉特定的cpu架构的文件


通过lipo看到x86_64和arm64是一样的架构,还是编译配置有问题,修改target后终于成功编出来了,而且后面的nghttp2 和 libcurl也很顺利的编译出来了。


2.5 动态库静态库混乱


成功编译出libcur后终于可以编译自己的代码了,但是一运行脚本啥样了,还是前面一样的错,各种Undefined symbols错误。一下没有思路了,最后去找iOS同学探讨了一波,最后才想起来,自己项目的cmake脚本中配置的编译产物都是动态库,而iOS是需要静态库,动态库依赖静态库就会有问题,最后终于在修改了几十个CMakeLists.txt后终于编译出了最终的产物。


3. 总结


一方面没有仔细了解openssl的Configurations配置规则,碰运气似的尝试以及后面学习这些规划花费了些时间;二是动态库引用静态库导致的问题自己误以为是版本不匹配问题浪费了很多时间。

相关实践学习
达摩院智能语音交互 - 声纹识别技术
声纹识别是基于每个发音人的发音器官构造不同,识别当前发音人的身份。按照任务具体分为两种: 声纹辨认:从说话人集合中判别出测试语音所属的说话人,为多选一的问题 声纹确认:判断测试语音是否由目标说话人所说,是二选一的问题(是或者不是) 按照应用具体分为两种: 文本相关:要求使用者重复指定的话语,通常包含与训练信息相同的文本(精度较高,适合当前应用模式) 文本无关:对使用者发音内容和语言没有要求,受信道环境影响比较大,精度不高 本课程主要介绍声纹识别的原型技术、系统架构及应用案例等。 讲师介绍: 郑斯奇,达摩院算法专家,毕业于美国哈佛大学,研究方向包括声纹识别、性别、年龄、语种识别等。致力于推动端侧声纹与个性化技术的研究和大规模应用。
目录
相关文章
|
7月前
|
jenkins Unix 持续交付
个人记录jenkins编译ios过程 xcode是9.4.1
个人记录jenkins编译ios过程 xcode是9.4.1
109 2
|
7月前
|
缓存 编解码 测试技术
基于iOS平台的高效图片处理技术实践
【4月更文挑战第7天】 在移动应用开发领域,图片处理是一个常见且要求高性能的功能模块。特别是在iOS平台上,由于其封闭的生态系统和用户对流畅体验的高期待,开发者需采用高效的图片处理技术以满足应用的性能需求。本文将探讨一种针对iOS平台优化的图片处理流程,涉及图像加载、缓存策略、异步处理以及图形渲染等关键技术点,旨在为iOS应用提供一个低内存消耗、高效率的图片处理解决方案。
|
25天前
|
安全 Swift iOS开发
Swift 与 UIKit 在 iOS 应用界面开发中的关键技术和实践方法
本文深入探讨了 Swift 与 UIKit 在 iOS 应用界面开发中的关键技术和实践方法。Swift 以其简洁、高效和类型安全的特点,结合 UIKit 丰富的组件和功能,为开发者提供了强大的工具。文章从 Swift 的语法优势、类型安全、编程模型以及与 UIKit 的集成,到 UIKit 的主要组件和功能,再到构建界面的实践技巧和实际案例分析,全面介绍了如何利用这些技术创建高质量的用户界面。
29 2
|
3月前
|
安全 Android开发 数据安全/隐私保护
探索安卓与iOS的安全性差异:技术深度分析与实践建议
本文旨在深入探讨并比较Android和iOS两大移动操作系统在安全性方面的不同之处。通过详细的技术分析,揭示两者在架构设计、权限管理、应用生态及更新机制等方面的安全特性。同时,针对这些差异提出针对性的实践建议,旨在为开发者和用户提供增强移动设备安全性的参考。
150 3
|
4月前
|
iOS开发
IOS编译出现Command PhaseScriptExecution failed with a nonzero exit code
IOS编译出现Command PhaseScriptExecution failed with a nonzero exit code
327 2
|
4月前
|
iOS开发
IOS编译报错‘ZipArchive.h‘ file not found|Use of undeclared identifier ‘SSZipArchive‘
IOS编译报错‘ZipArchive.h‘ file not found|Use of undeclared identifier ‘SSZipArchive‘
68 1
|
4月前
|
开发工具 数据安全/隐私保护 iOS开发
探索iOS应用开发的核心理念与实践
【8月更文挑战第23天】在数字时代的浪潮中,iOS应用开发不仅仅是技术的堆砌,更是一场关于创新、用户体验和持续改进的旅程。本文将深入探讨iOS应用开发的核心理念,从设计哲学到开发工具的选择,再到市场趋势的适应,旨在为开发者提供一条清晰的路径,帮助他们在不断变化的技术世界中保持竞争力和创新力。
|
5月前
|
移动开发 开发工具 Android开发
探索安卓与iOS开发的差异:平台特性与编程实践
【7月更文挑战第8天】在移动开发的广阔天地中,安卓和iOS这两大操作系统各自占据着半壁江山。它们在用户界面设计、系统架构及开发工具上展现出截然不同的特色。本文将深入探讨这两个平台在技术实现和开发生态上的关键差异,并分享一些实用的开发技巧,旨在为跨平台开发者提供有价值的见解和建议。
|
6月前
|
安全 IDE Android开发
探索Android与iOS开发的差异:平台特性与编程实践
【6月更文挑战第17天】在移动应用开发的广阔天地中,Android和iOS两大平台各自占据半壁江山。它们在用户群体、系统架构以及开发环境上的差异,为开发者带来了不同的挑战和机遇。本文深入探讨了这两个平台在技术实现、界面设计、性能优化等方面的主要区别,并提供了实用的开发建议,旨在帮助开发者更好地理解各自平台的特性,从而创造出更加优秀的移动应用。
|
7月前
|
iOS开发 开发者 UED
iOS 中的并发编程:GCD 与 Operation 的对比与实践
【4月更文挑战第23天】 在iOS开发中,为了提高应用的性能和响应能力,理解并合理运用并发编程是至关重要的。本文将深入探讨两种主要的并发模式:Grand Central Dispatch (GCD) 和 NSOperation。我们将比较它们的优势和局限性,并通过代码示例演示如何在实际场景中应用这两种技术来优化应用性能。文章旨在为开发者提供一个清晰的指南,以便在选择适合自己项目的并发工具时做出明智的决策。