Step by step. The littlest Pascal demo now builds in Xcode, gets packaged as a signed iOS app, installs into my iPhone, and runs.
Screenshot attached, Android phone on the left, iPhone on the right.
The code putting up the message box is the same:
procedure dwmain(argc: Integer; argv: PPChar); cdecl;
begin
dw_init(TRUE, argc, argv);
dw_messagebox('Free Pascal + dwindows', DW_MB_OK or DW_MB_INFORMATION, 'Hello from Pascal, courtesy of dwindows!');
dw_exit(0);
end;
Scaffolding is different: on Android, the Pascal program is built as a shared library, dwindows is another shared library, while on iOS the Pascal program becomes an executable and dwindows is a framework.
Next is to build a demo with more GUI widgets.
Beyond the short term, as I see it, the best approach to building Android/iOS apps with a common Pascal code base is to use HTML/CSS through the web widget, like what my fpwebview does for the desktop platforms. (Indeed, recurring question for webview is whether it works for Android and iOS.)
Using, say, mORmot to do server-side rendering fully, the app should require minimal to zero Javascript on the front end. Concerns about latency, state management etc that motivated the creation of fancy Javascript front-end frameworks go away as the app is effectively a single-user single-browser tab on-device web app.
Alright, that sounds like a plan.