Running RoboVM/libgdx iOS app - ios

I'm trying to develop an iOS app using RoboVM and libgdx. So far, I've just created a simple project, and have been trying to get it to run on iOS. So far, the farthest I've gotten is running this command:
robovm -verbose -arch x86 -os ios -cp robovm/lib/robovm-objc.jar:robovm/lib/robovm-cocoatouch.jar -jar <project>.jar
This generates a directory with a file called Info.plist, a file called <package_name>.<main_class>, and a lib directory. The file called <package_name>.<main_class> is a Mach-O executable i386. How would I go about running the file, and how would I go about uploading it to an iPhone as an app? There doesn't seem to be much documentation on RoboVM, and I've never really used a mac before, so I apologize if I'm missing something obvious.
Edit: To clarify, I want to both know how to run the app that was generated by RoboVM after I ran the command above, and to know how to upload that app to an iPhone to run it there. Preferably, I'd like to do this all without the RoboVM eclipse plugin.

Did you use the setup UI of libgdx? If so you can easy run the project:
iOS RoboVM: Right click the robovm project, Run As -> iOS Device App to run on a connected device, or Run As -> iOS Simulator App to run on the iOS simulator. If you run on a device, you need to provision it to be able to deploy to it! [Link about how to start developing with libgdx]
Install roboVM plugin for eclipse. Create the Projects with the setup UI. (Core and RoboVM) And rightclick the robo project Run As -> iOS and it should work.
You do not run it with commandline if you use libgdx. You are missing alot of lib and backend stuff from libgdx which need to be compiled too.
Moreover if you want to upload it to a device you need an Provision.

Related

Flutter on OSX M1 Mac gives error on xcode_backend.sh, about xcode project version when building for simulator

I'm on an M1 Mac Mini, Monterey 12.0.1, with XCode 13.1 & it's command-line tools and freshly-installed Flutter MacOS 2.8.0. I create a base Flutter project with
flutter create appname
When I do "flutter run" in the ios folder (in the parent folder it launches ok in Chrome), I get the message:
Could not build the application for the simulator.
Error launching application on iPhone 13.
I tried it with the simulator running, and not. It looks like the Runner XCode project build stages runs a script, xcode_backend.sh. I also tried loading the project in the XCode UI to build and get 'Command PhaseScriptExecution failed with a nonzero exit code' on that script.
If I go and run this script directly, from the project folder of the ios folder:
guy#Guys-Mac-mini ios % /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh"
I get the message:
error: Your Xcode project is incompatible with this version of Flutter. Run "rm -rf ios/Runner.xcodeproj" and "flutter create ." to regenerate.
I tried the steps indicated, which I also found on Google, and removed the folder and regenerated the project, but the same message is appearing. (I did export the FLUTTER_ROOT environment variable, both in the shell and it's also defined in the XCode project settings.
I can build and run the flutter apps to Chrome, but not for the iOS simulator. I also have no problem building and running Swift apps I've coded on the simulator.
I got my Windows and Android setup running in minutes, but on the M1 Mac it's been hours without success. Any ideas?
I'm a developer with decent of experience, but this is my first stab at Flutter and cross-platform (other than Xamarin). Any help is appreciated.
I can't fully explain it, but the problem I was having was related to my having the project files on an SMB share I was accessing from the Mac.
I setup the project on an SMB share so I could access it from my Windows and Mac workstations. I found that any flutter project on that share would fail compilation.
To test this, I created a new flutter app on my Mac Documents folder, comiled and ran it succesfully in the iOS simulator using 'flutter run'. When I moved that project to the SMB share and tried to run it, I got the compilation error again, and it wouldn't run (I also tried clean and run). I moved the project back to the local drive Documents folder, and was able to run it again.
I also noticed that the Mac access to the SMB share is painfully slow, though I tried a required_signon fixes from
https://kb.synology.com/en-us/DSM/tutorial/What_can_I_do_to_fix_slow_SMB_file_transfers_on_OS_X_10_11_5 but it didn't help.
I had even tried to factory reset my Mac, and I thought that fixed it, but it was only because I hadn't connected to the share yet, and made a test project on the local drive.
PS: I don't expect to use the exact same Flutter project between the Mac and Windows workstations because of paths and SDK locations, but I am using it as a convenient place for transfering the source files.
My team was able to solve this by supplying an absolute path to the xcode_backend script in a run phase and running it. Running it once seemed to be enough and we could remove it thereafter:
/bin/sh "/absolute-path-to-flutter/packages/flutter_tools/bin/xcode_backend.sh" thin
/bin/sh "/absolute-path-to-flutter/packages/flutter_tools/bin/xcode_backend.sh" embed

React Native app not running in XCode iOS simulator

I try to make my first steps using React Native. Development for Android (on Windows host) works. Now I wanted to test iOS, and tried to set up a development environment on a MacBook Pro.
Problem: React Native starts the iOS simulator, and then nothing happens any more. The simulator runs OK, but my React native app won't start.
What do I need to do to get my React Native installation going?
More Info:
I set up XCode and React Native according to the docs on the MacBook Pro running OSx 10.13.2 (High Sierra). XCode was installed and tested successfully, including the simulator.
When I installed Node.js I deliberately picked an older version (containing npm 4.2.0), since forums say that React Native does still have problems with npm 5. I also installed Homebrew and Watchman, like stated in the docs.
To initialize an empty project, I used
create-react-native-app HelloWorldProject
and a projet structure got created in my Documents folder.
If I finally fire up my "Hello World" test app using
cd HelloWorldProject
sudo react-native run-ios
the system responds:
Starting packager ...
Starting simulator ...
and then nothing happens. The simulator does indeed start (boot --> apple logo --> progress bar --> IOs start screen), but nothing happens afterwards.
Edit
I have given up on React Native for several reasons, I leave this question here for documentary purposes, but I cannot verify or accept any answer, I don't have a React Native development environment any more.
It's probably because you used sudo. /.expo/ is owned by root. Try to change the ownership with
sudo chown -R `whoami` ~/.expo
Refer https://github.com/react-community/create-react-native-app/issues/422
Even everything in your app seems fine, sometime you face the issue that the app is taking too much time to load either through terminal or Xcode. If there is no any other specific issue with your project, the following solution works most of the time:
Go to your app folder and then go to 'iOS' folder.
Delete 'Podfile.lock' and 'Pods' folder.
Execute the following command in Terminal from your 'ios' folder, that will bring back the 'Podfile.lock' and required Pods will be installed to 'Pods' folder:
pod install
Delete the 'build' folder in your 'iOS' folder.
Run the following command in terminal:
react-native run-ios
While the terminal is running, open '.xcworkspace' in your 'ios' folder in Xcode.
The above steps will make sure it will be build your react native project newly and will run on the simulator.
Thanks
Wasantha Wijayaratna

Developing Unity game on Windows for iOS devices

My unity application is developed for iOS devices, but for some reason at this moment I have only Windows PC.
I searched around and found similar information, but not clear for what I want.
My query is
I will do development of the game in Windows PC using C#.
Then will build and deploy to iOS device using MAC.
Is that possible? I like to make sure.
I have made several Unity3D projects for iOS using a Windows.
When installing Unity, don't forget to check "iOS deployment" and your Unity (on Windows) will be able to build an Xcode project.
Then, just transfer this Xcode project on a Mac with Xcode installed and you will be able to compile the project in order to be run on your iOS device.
Note : I just have to run chmod 777 MapFileParser.sh on the Mac folder containing the Xcode project before compiling with Xcode.
You can always use Unity Cloud to build you games. Their server will build it either from your own repo (git, svn, etc) or you can use their Collaborate feature by going into the unity editor -> services -> collaborate on.
Before getting to use Unity Cloud to build for iOS, you will need to generate your certificates just as you do when building using XCode. On the config page you can choose the version of unity you want the build to use, the version of xcode and if you want Unity to build your game on every push ( auto-build).
As far as I know when building for ios the ipa will have a ridiculous size. If you encounter this problem please refer to the following link: how to disable bitecode
Even though Unity allows us to use their system to build for any platform, in order to upload your *.ipa to app store you will need to do it through application loader.

Still not possible to use Eclipse instead of XCode for building an iOS app?

I'm developing a Phonegap/Cordova app for Android and iOS. For Android I use Eclipse on Windows. On Mac OS X you seem to be forced to use XCode, but since there's Eclipse on OS X too, I would like to use only that.
I found out that this was not possible in the past, but maybe it is these days.
Eclipse is a better editor than XCode in my opinion.
So my question is, is it even possible to develop, build and run for iOS in Eclipse ? Or does everybody use XCode ?
You can't code, build and compile iOS app using eclipse. You need to use terminal/CMD to build your cordova project and XCode to compile and run into your simulator or actual device.
Since cordova 3 was launched, you can use any editor you want, sublime, brackets, eclipse or any other.
You create the project with the cordova CLI and you work with the files on the root www folder.
You can use the CLI to run the app and generate the .ipa and .apk files, so you don't need xcode at all.
So answering your question, yes, you can use eclipse to create the app, but you have to use the CLI to run and install the app, eclipse doesn't have cordova CLI integration
Other IDEs like netbeans have eclipse integration, and editors like brackets have a cordova plugin to run the CLI from there

How to install cordova(phonegap) ios app to device via cli and not via xcode

I am trying to create a simple project with last phonegap version:
$ phonegap create my-project
$ phonegap build ios
$ phonegap install ios
All works perfectly and I see emulator with my simple application.
But I can't find documentation on how to run my application on device(iphone, for example) and not on a simulator.
All documentation by cordova / phonegap based on examples with cordova's template for xcode.
But last cordova's version don't have template for xcode and all that I need - cli, if I understand correctly?
I already registered as IOS developer and I have a valid iPhone development certificate.
When I connect my device - I can see it in xcode and I can run native application on my device.
But only via xcode.
I will be grateful to any advice.
If the cordova app builds and runs on the simulator, try running cordova run ios --device
This worked for me, when before it was only hitting the simulator.
Alternatively, if that STILL doesn't work for you, when you run codova build ios, to just build the app, you could use itunes to sync the generated .app file in <project_folder>/platforms/ios/build/device/AppName.app
There is an Apple CLI tool canned xcodebuild, as well as this wrapper around it by Facebook. I'd suggest trying out either that or look at the build-in xcodebuild shipped with xcode.
Hopefully one of them will work.
https://github.com/facebook/xctool
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html
If you use Cordova CLI, you should be able to do this:
cordova run ios

Resources