iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
LLaMA
V2EX  ›  iDev

有可能实现用 PHP 写 iOS 应用(客户端 !不是服务端!)吗?

  •  
  •   LLaMA · Apr 29, 2023 · 4365 views
    This topic created in 1135 days ago, the information mentioned may be changed or developed.
    Supplement 1  ·  Apr 29, 2023
    我只是在别的论坛看到这个怪问题,大家都在说写不了,想知道为什么写不了,是什么东西没人去实现还是有什么限制。我是.NET 程序员,不会写 PHP
    16 replies    2023-04-30 10:39:19 +08:00
    iOCZ
        1
    iOCZ  
       Apr 29, 2023   ❤️ 1
    金子能擦屁股吗?当然可以。
    okakuyang
        2
    okakuyang  
       Apr 29, 2023
    不行,没有这个手段
    jiayouzl
        3
    jiayouzl  
       Apr 29, 2023
    你想多了,哈哈哈哈.跟我 2013 年学 php 时候的想法一样.
    hefish
        4
    hefish  
       Apr 29, 2023
    你说的这个不是没人尝试过。当然那时候尝试的是 android 。ios 因为控制在 apple 手里,所有的开发工具都是绕不过 xcode 的。所以,只要能说服厨子搞个 for ios 的 php runtime ,你说的实现用 php 写 ios 应用应该不是难事。
    seanzxx
        5
    seanzxx  
       Apr 29, 2023
    我觉得应该也可以吧。
    内置一个 web server 和 php 解释器,然后输出 html ,再封装成一个 app 就好了。
    php 作为最好的编程语言之一,没有什么做不了。
    Helsing
        6
    Helsing  
       Apr 29, 2023 via iPhone
    有可能,两种方向:

    1. 要弄一个 iOS 的 PHP 运行时环境

    2. 搞一个编译器把 PHP 代码转译成 iOS 平台代码,类似 Flutter 或 KMM 那样
    R4rvZ6agNVWr56V0
        7
    R4rvZ6agNVWr56V0  
       Apr 29, 2023   ❤️ 1
    需要做大量的封装、Runtime 支持,但是没人会做这种吃力不讨好的事儿。没啥实实在在的收益,等同于用 Basic 语言开发安卓系统 APP 。
    fatekey
        8
    fatekey  
       Apr 29, 2023
    越狱了随便跑 php 程序,但是有什么意义呢
    icestraw
        9
    icestraw  
       Apr 29, 2023
    运行是没有限制的,但是上架有
    jtsai
        10
    jtsai  
       Apr 29, 2023
    没有 谁会去实现这个
    huijiewei
        11
    huijiewei  
       Apr 29, 2023
    @seanzxx 然后呢,怎么和系统的 API 交互呢。还不是得自己再写一套 runtime 调用。
    kingjpa
        12
    kingjpa  
       Apr 29, 2023
    就和用 excel 画图一样,也不是不行,但实在是有点牵强。
    往往这是新手的问题,试图用一种语言来适用所有场景,等经验多了就明白为什么了。
    ysc3839
        13
    ysc3839  
       Apr 30, 2023 via Android
    如果要上架应用商店,不行,苹果禁止动态代码执行。
    如果不上架,只是要运行的话,大概率可以,需要研究一下把 PHP 依赖但 iOS 没有的 API 去掉或者转译。
    aeof
        14
    aeof  
       Apr 30, 2023 via Android
    别人是拿了斧头把什么都看成是钉子,你是拿了斧头把什么都变成钉子
    cwcc
        15
    cwcc  
       Apr 30, 2023
    beyondcode 的 CTO 最近在搞 Apple 上面用 Laravel 写 Desktop App ,他和我联系了说理论上 iOS 也可能会让它跑起来。其实核心还是把 php 编译到 iOS 上,同时保持链接库没问题。但是 php 是解释器,我不清楚苹果究竟对这类解释器的容忍度有多少,想做上去是不难的。
    cooper
        16
    cooper  
       Apr 30, 2023
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2681 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 117ms · UTC 10:55 · PVG 18:55 · LAX 03:55 · JFK 06:55
    ♥ Do have faith in what you're doing.