Compile native executables for iOS using GraalVM's native-image
You need to have brew installed: https://brew.sh
-
Download
graalvm-ce-java11-darwin-amd64-20.2.0-dev.tar.gz
, the developer version of graalvm's SDK, from https://github.com/graalvm/graalvm-ce-dev-builds/releasestar -C /usr/local/opt/ -xvf /path/to/graalvm-ce-java11-darwin-amd64-20.2.0-dev.tar.gz
-
Install libimobiledevice, native iOS libraries:
brew install --HEAD libimobiledevice
-
export GRAALVM_HOME=/usr/local/opt/graalvm-ce-java11-20.2.0-dev/Contents/Home
-
export JAVA_HOME=$GRAALVM_HOME
-
git clone https://github.com/m3hdi652/java-ios.git && cd java-ios/HelloJava
-
Using Maven:
mvn client:build
-
If the compilation is successful,
HelloJava
will appear in dist folder -
You can fake-sign the binary by using ldid:
brew install ldid
ldid -S HelloJava
-
You also can codesign the binary, if you have a free or paid developer account:
Get your identity by
security find-identity -p codesigning -v
e.g:- 2CD708151B6469F3D4B0F05F48338B81F1809C82 "Apple Development: [email protected] (5J8I29WF1D)"
1 valid identities found
codesign -fs "Apple Development: [email protected] (5J8I29WF1D)" /path/to/binary
- 2CD708151B6469F3D4B0F05F48338B81F1809C82 "Apple Development: [email protected] (5J8I29WF1D)"
Read LICENSE
https://github.com/graalvm/graalvm-ce-dev-builds
https://github.com/gluonhq
https://github.com/gluonhq/client-samples
https://github.com/gluonhq/substrate