iphonesim icon indicating copy to clipboard operation
iphonesim copied to clipboard

Does not work with xCode 4.3 and newer

Open dodikk opened this issue 12 years ago • 12 comments

Since xCode 4.3 Apple has changed its location to /Applications/Xcode.app Due to those changes I'm unable to use the "iphonesim" tool (see the log below).

Please update your code base to keep up with the latest xCode.

Oleksandrs-Mac-mini:Release-iphonesimulator dodikk$ ls CoreDataBooks.app CoreDataBooks.app.dSYM

Oleksandrs-Mac-mini:Release-iphonesimulator dodikk$ iphonesim launch "/Users/dodikk/projects/research/zucchini/CoreDataBooks/build/Release-iphonesimulator/CoreDataBooks.app" 5.0 iphone dyld: Library not loaded: @rpath/DevToolsFoundation.framework/Versions/A/DevToolsFoundation Referenced from: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework/Versions/A/iPhoneSimulatorRemoteClient Reason: image not found Trace/BPT trap: 5

dodikk avatar Apr 06 '12 14:04 dodikk

dodikk : have you find any solution for this???

sgadhvi avatar Apr 16 '12 12:04 sgadhvi

Take a look at UIAutomation based approach here : https://github.com/farcaller/ios-tdd/tree/master/Tests/Jasmine

It works with gh-unit just fine. Consider using OCUnit instead. At the moment it's capable of of being debugged and handling bundles.

dodikk avatar Apr 17 '12 08:04 dodikk

Anyway, last commit in this repo is 2 years old. The project looks abandoned.

In my opinion, there is no point to bring "iphonesim" back to life as approaches, mentioned above are good enough for most users ( including myself ).

dodikk avatar Apr 17 '12 08:04 dodikk

how did you solve this? I would like to try iphonesim, as I don't have success with ios-sim...

haemi avatar May 01 '12 08:05 haemi

I have not solved this. I used the other approach based on apple's UIAutomation. (consider the link above)

iphonesim does not work with "xCode 4.3" and newer. And I don't think it will ever get fixed.

dodikk avatar May 02 '12 15:05 dodikk

hi, I got a idea from http://developer.appcelerator.com/question/132298/an-ios-sdk-is-missing and solved the problem on xcode 4.3 by setting the correct rpath in project settings.

  1. open iphonesim.xcodeproj in Xcode 4.3

  2. go to the project settings, select target "iphonesim"

  3. in "build phases", add the following framework to "Link Binary With Libraries"

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework

  4. in "build settings", remove all original setting in "Other Linker Flag" and set it as follow:

    -Wl,-rpath -Wl,$(DEVELOPER_DIR)/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks -Wl,-rpath -Wl,$(DEVELOPER_DIR)/../OtherFrameworks

  5. build the project, it should be ok now.

oylbin avatar May 03 '12 03:05 oylbin

hi guys , i find a fork of this repo at https://github.com/Fingertips/ios-sim , it has additional features and support Xcode 4.3

oylbin avatar May 03 '12 04:05 oylbin

both doesn't work for me, unfortunately; ios-sim give a session-timeout (http://stackoverflow.com/questions/10408389/ios-sim-doesnt-start-app-correctly-in-simulator) and iphonesim can't build with the changes:

ld: in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks, can't map file, errno=22 for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

haemi avatar May 03 '12 05:05 haemi

oylbin, do you have a fork/pull request with your idea implementation?

P.S. When I fixed path to the iPhoneSimulatorRemoteClient.framework I was still getting a runtime crash.

dodikk avatar May 04 '12 08:05 dodikk

Was in the same boat as you guys.

Abit more digging shows https://jira.appcelerator.org/browse/TISTUD-1196

Retrying with pegli's branch works: https://github.com/pegli/ios-sim

git clone https://github.com/pegli/ios-sim.git

Good luck :D

Ryandev avatar May 05 '12 22:05 Ryandev

I've finally got it working. https://github.com/EmbeddedSources/iphonesim/ The solution has been based on "moredip/iphonesim" work.

By default it does not wait for tests completion. I've fixed that in "EmbeddedSources/iphonesim" fork, which now has both "iphonesim launch" and "iphonesim launch-async" capabilities.

dodikk avatar May 07 '12 08:05 dodikk

Summarizing the discussion above, we have the following working ways to launch an app in the simulator :

  1. "pegli/ios-sim" - checked by @mcCuppaT
  2. "moredip/iphonesim" --> "EmbeddedSources/iphonesim" - checked by @dodikk
  3. UIAutomation approach by @farcaller -- https://github.com/farcaller/ios-tdd/tree/master/Tests/Jasmine
  4. www.zucchiniframework.org

Thanks everyone.

dodikk avatar May 07 '12 08:05 dodikk