I'm getting an error when trying to run openfl test ios -simulator

I have the latest version of Haxe 3 installed along with the latest version of Xcode and openFL.

I’m inside my openFl project in the terminal and I run the following command

openfl test ios -simulator
I get the following error.

/Applications/Xcode.app/Contents/Developer/usr/bin/make
Haxe device build: Release-iphoneos-v7
haxe Build.hxml -D HXCPP_ARMV7 -cpp build/Release-iphoneos-v7
cd build/Release-iphoneos-v7; export HXCPP_NO_COLOR=1; haxelib run hxcpp Build.xml -Dios -Diphone -DHXCPP_ARMV7 -DHXCPP_CPP11  -DHXCPP_CLANG -DOBJC_ARC `cat Options.txt | while read LINE; do printf " -D$LINE"; done`
Error: Could not find build target "by"
make: *** [build-haxe-armv7] Error 1
Command /Applications/Xcode.app/Contents/Developer/usr/bin/make failed with exit code 2

I made sure that the latest Xcode is installed and can build a project on it’s own just fine. I’m running Xcode 8.

I solved this problem by working around the error doing the following.

First export IPHONE_VER=10.0

Then run
openfl test ios -simulator -Dsource-header=haxe

But now it fails to launch the ios simulator after building :frowning:

Launch app on "com.apple.CoreSimulator.SimDeviceType.iPhone-6, 10.0"
2016-10-03 10:08:02.612 ios-sim[4877:74752] Timeout: 60.000000 second(s)
Failed to find class DTiPhoneSimulatorSystemRoot at runtime.

Would you mind trying this?

openfl update ios -Dsource-header=haxe -xcode

When Xcode opens, try and use the menu option to deploy to the simulator

Thanks :slight_smile:

@singmajesty I was able to do what you suggested. It just took forever for it to build in xcode and launch. This allows me to test but ideally is not the workflow that I prefer. I’d like to just build and debug in the simulator without this extra step.

Apple provides no first-party way to deploy to a simulator without Xcode, the third-party tool we use to deploy must not work anymore. We’ll try and look at getting a newer version (or patching the tool) so that it works again. If you don’t change template files or defines, you should be able to hit build again in Xcode to get newer Haxe code changes.

Sorry for the inconvenience! Sorry Apple hasn’t made this easier. We’ll try and get strict command-line deployment running again

1 Like

@singmajesty I know that Apple doesn’t make it easy. Is there anything I can do to help. I wouldn’t mind contributing to work on OpenFL. Hit me up on twitter DM matthewswallace

What is the third party tool that OpenFL is using in order to deploy to the simulator? I wouldn’t mind doing some investigation as well.

Just sent a PM here on the forums :slight_smile: