{"id":346248,"date":"2023-03-03T21:00:48","date_gmt":"2023-03-03T21:00:48","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=346248"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=346248","title":{"rendered":"<span>C\/C++ \u0438\u0437 Python (Kivy, ctypes) \u043d\u0430 iOS<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" alt=\"main\" width=\"500\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/od\/3g\/1g\/od3g1gje63sbgpv4fhijgmdkpbg.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/od\/3g\/1g\/od3g1gje63sbgpv4fhijgmdkpbg.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 \u044f \u043f\u0438\u0441\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/466499\/\">C\/C++ \u0438\u0437 Python (ctypes)<\/a>, <a href=\"https:\/\/habr.com\/ru\/post\/656453\/\">C\/C++ \u0438\u0437 Python (Kivy, ctypes) \u043d\u0430 Android<\/a>. \u0412 \u043d\u0438\u0445 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430 <strong>Linux<\/strong> \u0438 <strong>Android<\/strong>. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043a\u0430\u043a \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 <strong>iOS<\/strong>. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e \u0441\u0431\u043e\u0440\u043a\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0445, \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u0445 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u041a\u043e\u0434 \u043d\u0430 <strong>C\/C++<\/strong> \u043d\u0438 \u043a\u0430\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u0440\u043f\u0435\u043b. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e <a href=\"https:\/\/habr.com\/ru\/post\/466499\/\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a> \u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"instrumenty-sborki\">\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u0431\u043e\u0440\u043a\u0438<\/h2>\n<p>  <\/p>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Mac OS Ventura 13, \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043d\u0430 \u043d\u0435 Mac OS \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. MacBook \u0438\u043b\u0438 iMac \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442. <a href=\"https:\/\/help.reg.ru\/support\/vydelennyye-servery-i-dc\/vmware-virtualnyy-data-tsentr\/sozdaniye-i-nastroyka-virtualnykh-mashin\/ustanovka-macos-na-vmware-workstation\" rel=\"nofollow noopener noreferrer\">\u0421\u0442\u0430\u0442\u044c\u044f<\/a> \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 macOS \u043d\u0430 VMware Workstation.<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" width=\"200\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/le\/fv\/ow\/lefvowur6opq7mhfvx-xtex_tx4.png\" data-src=\"https:\/\/habrastorage.org\/webt\/le\/fv\/ow\/lefvowur6opq7mhfvx-xtex_tx4.png\"\/><\/div>\n<p>  <\/p>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li>Xcode<\/li>\n<li>App Developer<\/li>\n<li>brew<\/li>\n<\/ul>\n<p>  <\/p>\n<p>Xcode &amp; App Developer \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 <strong>App Store<\/strong>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/mp\/pq\/om\/mppqomcyh2ije4tyte6w5wcibyc.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/mp\/pq\/om\/mppqomcyh2ije4tyte6w5wcibyc.jpeg\" data-blurred=\"true\"\/>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">xcode-select --install  # Xcode is not fully installed. Run this to complete the install: xcodebuild -runFirstLaunch<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 brew:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">\/bin\/bash -c \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh)\"<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0434\u043e\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">brew install autoconf automake libtool pkg-config sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer brew link libtool<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"c\">C<\/h2>\n<p>  <\/p>\n<p>test.c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include \"test.h\"  int a = 5; double b = 5.12345; char c = 'X';  int  func_ret_int(int val) {      return val; }   double  func_ret_double(double val) {      return val; }   char * func_ret_str(char *val) {      return val; }   char func_many_args(int val1, double val2, char val3, short val4) {      return val3; }   test_st_t * func_ret_struct(test_st_t *test_st) {              return test_st; }  <\/code><\/pre>\n<p>  <\/p>\n<p>test.h:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#ifndef _TEST_H_ #define _TEST_H_  #ifdef  __cplusplus extern \"C\" { #endif  typedef struct test_st_s test_st_t;  extern int a; extern double b; extern char c;  int func_ret_int(int val); double func_ret_double(double val); char *func_ret_str(char *val); char func_many_args(int val1, double val2, char val3, short val4); test_st_t *func_ret_struct(test_st_t *test_st);  struct test_st_s {     int val1;     double val2;     char val3; };  #ifdef  __cplusplus } #endif  #endif  \/* _TEST_H_ *\/<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c :<\/p>\n<p>  <\/p>\n<h4 id=\"clang\">clang<\/h4>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 <strong>arm64<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">clang -c -isysroot \/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/SDKs\/iPhoneOS.sdk -arch arm64 -fPIC -I.\/src\/c  -o src\/python\/ios\/libs\/arm64\/\/test.o .\/src\/c\/test.c clang -isysroot \/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/SDKs\/iPhoneOS.sdk -arch arm64 -shared -o src\/python\/ios\/libs\/arm64\/\/libtest.a src\/python\/ios\/libs\/arm64\/\/test.o strip -x src\/python\/ios\/libs\/arm64\/\/libtest.a<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b <strong>armv6<\/strong>, <strong>armv7<\/strong>.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 <strong>x86_64<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">clang -c -isysroot \/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneSimulator.platform\/Developer\/SDKs\/iPhoneSimulator.sdk -arch x86_64 -fPIC -I.\/src\/c  -o src\/python\/ios\/libs\/x86_64\/\/test.o .\/src\/c\/test.c clang -isysroot \/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneSimulator.platform\/Developer\/SDKs\/iPhoneSimulator.sdk -arch x86_64 -shared -o src\/python\/ios\/libs\/x86_64\/\/libtest.a src\/python\/ios\/libs\/x86_64\/\/test.o  strip -x src\/python\/ios\/libs\/x86_64\/\/libtest.a<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u043e\u0434\u043d\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u0432\u0441\u0435\u0445 \u043d\u0443\u0436\u043d\u044b\u0445 \u043d\u0430\u043c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u0445:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">lipo -arch armv7 src\/python\/ios\/libs\/armv7\/libtest.a -arch arm64 src\/python\/ios\/libs\/arm64\/libtest.a  -arch x86_64 src\/python\/ios\/libs\/x86_64\/libtest.a  -create -output src\/python\/ios\/libs\/libtest.a<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">bash-3.2$ lipo -info src\/python\/ios\/libs\/libtest.a  Architectures in the fat file: src\/python\/ios\/libs\/libtest.a are: armv7 x86_64 arm64  bash-3.2$ <\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u043d\u0430 C \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"c-1\">C++<\/h2>\n<p>  <\/p>\n<p>test.cpp:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include \"test.hpp\"  \/**  * \u041c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430  **\/ std::string test::ret_str(std::string val) {     std::cout &lt;&lt; \"C get ret_str: \" &lt;&lt; val &lt;&lt; std::endl;     return val; }  int test::ret_int(int val) {     std::cout &lt;&lt; \"C get ret_int: \" &lt;&lt; val &lt;&lt; std::endl;     return val; }  double test::ret_double(double val) {     std::cout &lt;&lt; \"C get ret_double: \" &lt;&lt; val &lt;&lt; std::endl;     return val; }  \/**  * \u041e\u0431\u0432\u044f\u0437\u043a\u0430 C \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 C++  **\/  \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 test, \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0435\u0433\u043e. test *test_new() {     return new test(); }  \/\/ \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043a\u043b\u0430\u0441\u0441 test. void test_del(test *test) {     delete test; }  \/*  * \u0412\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430.  *\/  \/\/ \u041e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 \u043c\u0435\u0442\u043e\u0434\u043e\u043c ret_str char *test_ret_str(test *test, char *val) {     \/\/ char * \u043a std::string     std::string str = test->ret_str(std::string(val));      \/\/ std::string \u043a char *     char *ret = new char[str.length() + 1];     strcpy(ret, str.c_str());      return ret; }  \/\/ \u041e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 \u043c\u0435\u0442\u043e\u0434\u043e\u043c ret_int int test_ret_int(test *test, int val) {     return test->ret_int(val); }  \/\/ \u041e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 \u043c\u0435\u0442\u043e\u0434\u043e\u043c ret_double double test_ret_double(test *test, double val) {     return test->ret_double(val); }  \/*  * \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430.  *\/  \/\/ \u041e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f a int test_get_a(test *test) {     return test->a; }  \/\/ \u041e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f b double test_get_b(test *test) {     return test->b; }  \/\/ \u041e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f c char test_get_c(test *test) {     return test->c; } <\/code><\/pre>\n<p>  <\/p>\n<p>test.hpp:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#ifndef _TEST_HPP_ #define _TEST_HPP_  #include &lt;iostream> #include &lt;string>  class test { public:     int a = 5;     double b = 5.12345;     char c = 'X';      std::string ret_str(std::string val);     int ret_int(int val);     double ret_double(double val); };  #ifdef __cplusplus extern \"C\" { #endif      test *test_new();     void test_del(test *test);     char *test_ret_str(test *test, char *val);     int test_ret_int(test *test, int val);     double test_ret_double(test *test, double val);      int test_get_a(test *test);     double test_get_b(test *test);     char test_get_c(test *test);  #ifdef __cplusplus } #endif  #endif<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c :<\/p>\n<p>  <\/p>\n<h4 id=\"clang-1\">clang++<\/h4>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 <strong>arm64<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">clang++ -c -isysroot \/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/SDKs\/iPhoneOS.sdk -arch arm64  -fPIC -I.\/src\/c  -o src\/python\/ios\/libs\/arm64\/\/test.pp.o .\/src\/c\/test.cpp clang++ -isysroot \/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/SDKs\/iPhoneOS.sdk -arch arm64  -shared -o src\/python\/ios\/libs\/arm64\/\/libtestpp.a src\/python\/ios\/libs\/arm64\/\/test.pp.o  strip -x src\/python\/ios\/libs\/arm64\/\/libtestpp.a<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b <strong>armv6<\/strong>, <strong>armv7<\/strong>.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 <strong>x86_64<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">clang++ -c -isysroot \/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneSimulator.platform\/Developer\/SDKs\/iPhoneSimulator.sdk -arch x86_64  -fPIC -I.\/src\/c  -o src\/python\/ios\/libs\/x86_64\/\/test.pp.o .\/src\/c\/test.cpp clang++ -isysroot \/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneSimulator.platform\/Developer\/SDKs\/iPhoneSimulator.sdk -arch x86_64  -shared -o src\/python\/ios\/libs\/x86_64\/\/libtestpp.a src\/python\/ios\/libs\/x86_64\/\/test.pp.o  strip -x src\/python\/ios\/libs\/x86_64\/\/libtestpp.a<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u043e\u0434\u043d\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u0432\u0441\u0435\u0445 \u043d\u0443\u0436\u043d\u044b\u0445 \u043d\u0430\u043c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u0445:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">lipo -arch armv7 src\/python\/ios\/libs\/armv7\/libtestpp.a -arch arm64 src\/python\/ios\/libs\/arm64\/libtestpp.a  -arch x86_64 src\/python\/ios\/libs\/x86_64\/libtestpp.a  -create -output src\/python\/ios\/libs\/libtestpp.a<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">bash-3.2$ lipo -info src\/python\/ios\/libs\/libtestpp.a  Architectures in the fat file: src\/python\/ios\/libs\/libtestpp.a are: armv7 x86_64 arm64  bash-3.2$ <\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"python\">Python<\/h2>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a <strong>Kivy<\/strong>.<\/p>\n<p>  <\/p>\n<h3 id=\"ustanovka-kivy\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 kivy<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">pip3 install kivy-ios Cython<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 kivy \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 \u043f\u043e\u0434 \u043d\u0435\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">mkdir ios cd ios<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <strong>main.py<\/strong>, \u044d\u0442\u043e \u0442\u043e\u0447\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">touch main.py<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0435\u0433\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python3 #-*- coding: utf-8 -*-  import os import sys import ctypes, ctypes.util  import kivy kivy.require(\"1.9.1\") from kivy.app import App from kivy.uix.button import Button  # class in which we are creating the button class ButtonApp(App):      def build(self):         # use a (r, g, b, a) tuple         btn = Button(text =\"Push Me !\",                    font_size =\"20sp\",                    background_color = (1, 1, 1, 1),                    color = (1, 1, 1, 1),                    size_hint = (.2, .1),                    pos_hint = {'x':.4, 'y':.45})          # bind() use to bind the button to function callback         btn.bind(on_press = self.callback)         return btn      # callback function tells when button pressed     def callback(self, event):         exit(0)  ## #  \u0421\u0442\u0430\u0440\u0442. ## if __name__ == \"__main__\":      test = None     # \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438     try:         test = ctypes.CDLL('libs\/libtest.a')     except OSError as e:         print(str(e))         exit(0)      ###     ## C     ###      print(\"ctypes\\n\")     print(\"C\\n\")      ##     # \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438     ##      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 int     test.func_ret_int.restype = ctypes.c_int     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 int     test.func_ret_int.argtypes = [ctypes.c_int, ]      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 double     test.func_ret_double.restype = ctypes.c_double     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 double     test.func_ret_double.argtypes = [ctypes.c_double]      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 char *     test.func_ret_str.restype = ctypes.c_char_p     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 char *     test.func_ret_str.argtypes = [ctypes.POINTER(ctypes.c_char), ]      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 char     test.func_many_args.restype = ctypes.c_char     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b int, double. char, short     test.func_many_args.argtypes = [ctypes.c_int, ctypes.c_double, ctypes.c_char, ctypes.c_short]      print('\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438:')     print('ret func_ret_int: ', test.func_ret_int(101))     print('ret func_ret_double: ', test.func_ret_double(12.123456789))     # \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0431\u0430\u0439\u0442\u043e\u0432, \u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442\u043e\u0432 \u043a \u0441\u0442\u0440\u043e\u043a\u0435.     print('ret func_ret_str: ', test.func_ret_str('Hello!'.encode('utf-8')).decode(\"utf-8\"))     print('ret func_many_args: ', test.func_many_args(15, 18.1617, 'X'.encode('utf-8'), 32000).decode(\"utf-8\"))      ##     # \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438     ##      print('\\n\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438:')     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0442\u0438\u043f\u0430 int     a = ctypes.c_int.in_dll(test, \"a\")     print('ret a: ', a.value)      # \u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.     a.value = 22     a = ctypes.c_int.in_dll(test, \"a\")     print('new a: ', a.value)      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0442\u0438\u043f\u0430 double     b = ctypes.c_double.in_dll(test, \"b\")     print('ret b: ', b.value)      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0442\u0438\u043f\u0430 char     c = ctypes.c_char.in_dll(test, \"c\")     print('ret c: ', c.value.decode(\"utf-8\"))      ##     # \u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438     ##      print('\\n\u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438:')      # \u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 Python \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0432 C     class test_st_t(ctypes.Structure):         _fields_ = [('val1', ctypes.c_int),                     ('val2', ctypes.c_double),                     ('val3', ctypes.c_char)]      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 test_st_t *     test.func_ret_struct.restype = ctypes.POINTER(test_st_t)     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 void *     test.func_ret_struct.argtypes = [ctypes.c_void_p]      # \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443     test_st = test_st_t(19, 3.5, 'Z'.encode('utf-8'))      # Python None == Null C     # ret = test.func_ret_struct(None)     # print('ret func_ret_struct: ', ret) # \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 None, \u0442\u043e \u0435\u0433\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0430\u0437\u0430\u0434     ret = test.func_ret_struct(ctypes.byref(test_st))      # \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 C     print('ret val1 = {}\\nret val2 = {}\\nret val3 = {}'.format(ret.contents.val1, ret.contents.val2,                                                                ret.contents.val3.decode(\"utf-8\")))      ###     ## C++     ###      print(\"\\n\\nC++\\n\")      # \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438     try:         testpp = ctypes.CDLL('libs\/libtestpp.a')     except OSError as e:         print(str(e))         exit(0)      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c     testpp.test_new.restype = ctypes.c_void_p     # \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 test     test = testpp.test_new()      ##     # \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438     ##      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 char *     testpp.test_ret_str.restype = ctypes.c_char_p     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 void * \u0438 char *     testpp.test_ret_str.argtypes = [ctypes.c_void_p, ctypes.c_char_p]      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 int     testpp.test_ret_int.restype = ctypes.c_int     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 void * \u0438 int     testpp.test_ret_int.argtypes = [ctypes.c_void_p, ctypes.c_int]      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 double     testpp.test_ret_double.restype = ctypes.c_double     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 void * \u0438 double     testpp.test_ret_double.argtypes = [ctypes.c_void_p, ctypes.c_double]      print('\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438:')     # \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 1-\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441     print('ret test_ret_str: ', testpp.test_ret_str(test, 'Hello!'.encode('utf-8')).decode(\"utf-8\"))     print('ret test_ret_int: ', testpp.test_ret_int(test, 123))     print('ret test_ret_double: ', testpp.test_ret_double(test, 9.87654321))      ##     # \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438     ##      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 int     testpp.test_get_a.restype = ctypes.c_int     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 void *     testpp.test_get_a.argtypes = [ctypes.c_void_p]     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 double     testpp.test_get_b.restype = ctypes.c_double     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 void *     testpp.test_get_b.argtypes = [ctypes.c_void_p]     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 char     testpp.test_get_c.restype = ctypes.c_char     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 void *     testpp.test_get_c.argtypes = [ctypes.c_void_p]      print('\\n\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438:')     print('ret test_get_a: ', testpp.test_get_a(test))     print('ret test_get_b: ', testpp.test_get_b(test))     print('ret test_get_c: ', testpp.test_get_c(test).decode(\"utf-8\"))      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 void *     testpp.test_del.argtypes = [ctypes.c_void_p]     # \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043a\u043b\u0430\u0441\u0441     testpp.test_del(test)      ButtonApp().run()<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441 \u043e\u0434\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c C \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 \u043f\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442 <strong>xcode<\/strong>.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">mkdir ios-build cd ios-build<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u041e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e<\/strong>, \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u043f\u0440\u043e\u0435\u043a\u0442 xcode \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u0435\u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0432 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430 \u043f\u0430\u043f\u043a\u0430\u0445.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 xcode:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">toolchain build python3 kivy openssl # very long operation toolchain create test ~\/workspace\/c_from_python\/src\/python\/ios #&lt;full_path_to_my_app_source_directory><\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u0432 <strong>~\/workspace\/c_from_python\/src\/python\/ios<\/strong> \u0431\u0443\u0434\u0443\u0442 \u0432\u0437\u044f\u0442\u044b \u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435 (\u0434\u043b\u044f <strong>Android<\/strong> \u0432 <strong>buildozer.spec<\/strong> \u0432\u0441\u0435 \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c). \u0412 \u043a\u043e\u0440\u043d\u0435 <strong>~\/workspace\/c_from_python\/src\/python\/ios<\/strong> \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0444\u0430\u0439\u043b <strong>main.py<\/strong>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 xcode:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">open test-ios\/test.xcodeproj<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c:<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/7w\/al\/du\/7waldus9ma7_tcen9mm6v-wjclk.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/7w\/al\/du\/7waldus9ma7_tcen9mm6v-wjclk.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<h2 id=\"telefon\">\u0422\u0435\u043b\u0435\u0444\u043e\u043d<\/h2>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u043d\u0430 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435, \u0442.\u043a. <strong>iPhone<\/strong> \u0432 \u0436\u0435\u043b\u0435\u0437\u0435 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u2014 <strong>C\/C++<\/strong> \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c:<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/fw\/cu\/il\/fwcuilymvluricqnjosehled8vc.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/fw\/cu\/il\/fwcuilymvluricqnjosehled8vc.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443:<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" alt=\"main\" width=\"300\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/tb\/go\/eb\/tbgoebo64hs306byhogvcfikrii.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/tb\/go\/eb\/tbgoebo64hs306byhogvcfikrii.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043a\u0430\u043a \u043d\u0430\u0434\u043e. \u041d\u0430\u0436\u0430\u0442\u0438\u0435 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0411\u043e\u043b\u044c\u0448\u0435 \u043e\u043d\u043e \u043d\u0438 \u0447\u0435\u0433\u043e \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \ud83d\ude09<\/p>\n<p>  <\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"ssylki\">\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/dvjdjvu\/c_from_python\" rel=\"nofollow noopener noreferrer\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/466499\/\">C\/C++ \u0438\u0437 Python (ctypes)<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/656453\/\">C\/C++ \u0438\u0437 Python (Kivy, ctypes) \u043d\u0430 Android<\/a><\/li>\n<li><a href=\"https:\/\/help.reg.ru\/support\/vydelennyye-servery-i-dc\/vmware-virtualnyy-data-tsentr\/sozdaniye-i-nastroyka-virtualnykh-mashin\/ustanovka-macos-na-vmware-workstation\" rel=\"nofollow noopener noreferrer\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 macOS \u043d\u0430 VMware Workstation<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/720310\/\"> https:\/\/habr.com\/ru\/post\/720310\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" alt=\"main\" width=\"500\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/od\/3g\/1g\/od3g1gje63sbgpv4fhijgmdkpbg.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/od\/3g\/1g\/od3g1gje63sbgpv4fhijgmdkpbg.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 \u044f \u043f\u0438\u0441\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/466499\/\">C\/C++ \u0438\u0437 Python (ctypes)<\/a>, <a href=\"https:\/\/habr.com\/ru\/post\/656453\/\">C\/C++ \u0438\u0437 Python (Kivy, ctypes) \u043d\u0430 Android<\/a>. \u0412 \u043d\u0438\u0445 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430 <strong>Linux<\/strong> \u0438 <strong>Android<\/strong>. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043a\u0430\u043a \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 <strong>iOS<\/strong>. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e \u0441\u0431\u043e\u0440\u043a\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0445, \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u0445 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-346248","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/346248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=346248"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/346248\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=346248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=346248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=346248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}