motion-screenshots
motion-screenshots copied to clipboard
Compatible with RubyMotion 3.6?
I am trying to use motion-screenshots but can't seem to get it to work. When I run rake screenshots, no screenshots are created and the app blows up when I ctrl-c the terminal window running the simulator. As the setup seems dead simple, I'm a little confused as to what's wrong. I've included the shell output at the bottom of this (long) issue.
I've created a simple repository illustrating the behavior: https://github.com/mwise/motion-screenshots-test
A few things I've noticed:
- I've got no other CocoaPods installed in this contrived app - I'm not sure if that is causing the exit to blow up when it tries to reinstall my pods that don't exist. Seems like that might be the issue.
- The check for
KSScreenshotManageris failing on https://github.com/clayallsopp/motion-screenshots/blob/master/lib/motion/motion-screenshots.rb#L1 when I runrake screenshots. So I think that explains the screenshots not being taken but also not blowing up. It seems like maybe the `pod 'KSScreenshotManager' at https://github.com/clayallsopp/motion-screenshots/blob/master/lib/motion-screenshots.rb#L39 isn't being respected or something. - If I manually add the
KSScreenshotManagerpod via my app's rakefile, I get one of those beloved RubyMotion 'not precompiled' errors at runtime (not on exit as described above):
Objective-C stub for message `actionWithName:asynchronous:actionBlock:cleanupBlock:' type `@@:@c@?@?' not precompiled. Make sure you properly link with the framework or library that defines this message.
- If
rake screenshotsblows up on exit, the nextrake(notrake screenshots) will blow up, complaining about architecture flags or something:
→ rake
Build ./build/iPhoneSimulator-8.1-Development
Compile /tmp/motion_env_1425783585.rb
Link ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app/motion-screenshots-test
ld: warning: ignoring file ./build/iPhoneSimulator-8.1-Development/objs/Users/mark/projects/ios/rubymotion/motion-screenshots-test/app/app_screenshots.rb.o, missing required architecture x86_64 in file ./build/iPhoneSimulator-8.1-Development/objs/Users/mark/projects/ios/
rubymotion/motion-screenshots-test/app/app_screenshots.rb.o (1 slices)
ld: warning: ignoring file ./build/iPhoneSimulator-8.1-Development/objs/Users/mark/projects/ios/rubymotion/motion-screenshots-test/app/my_first_view_controller.rb.o, missing required architecture x86_64 in file ./build/iPhoneSimulator-8.1-Development/objs/Users/mark/proj
ects/ios/rubymotion/motion-screenshots-test/app/my_first_view_controller.rb.o (1 slices)
Undefined symbols for architecture x86_64:
"_MREP_319D6104414D487E945E0E0B9AA9A244", referenced from:
_RubyMotionInit in init.o
"_MREP_ABC42A576F184A6D9461F7E47F55A08F", referenced from:
_RubyMotionInit in init.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
rake aborted!
Command failed with status (1): [/Applications/Xcode.app/Contents/Developer...]
/Library/RubyMotion/lib/motion/project/builder.rb:322:in `build'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-env-0.0.4/lib/motion-env/builder.rb:32:in `build_with_env'
/Library/RubyMotion/lib/motion/project/app.rb:78:in `build'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:53:in `build_with_cocoapods'
/Library/RubyMotion/lib/motion/project/template/ios.rb:68:in `block (2 levels) in <top (required)>'
/Library/RubyMotion/lib/motion/project/template/ios.rb:189:in `block in <top (required)>'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks:15:in `eval'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => build:simulator
(See full trace by running task with --trace)
So yeah, I'm not really sure what's going on. Have you noticed anything like the what I've described? It seems like there might be a few different issues at play, but I tried to craft the "Hello World" of motion-screenshot implementations. I'm running RubyMotion 3.6, Ruby 2.1.2 on OS X. I'd be happy to try to PR a fix or two if you can point me in the right direction.
Shell output from borked rake screenshots run:
rake screenshots
WARNING! Forcing 32bit-only build target for screenshots..
Updating spec repo `master`
Already up-to-date.
CocoaPods 0.36.0.rc.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Analyzing dependencies
Downloading dependencies
Installing KSScreenshotManager (0.0.1)
Generating Pods project
Build ./build/iPhoneSimulator-8.1-Development
Compile /Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-screenshots-0.1.1/lib/motion/motion-screenshots.rb
Compile ./app/my_first_view_controller.rb
Compile ./app/app_screenshots.rb
Compile ./app/app_delegate.rb
Compile /tmp/motion_env_1425783989.rb
Create ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app
Link ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app/motion-screenshots-test
Create ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app/PkgInfo
Create ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app/Info.plist
Copy ./resources/[email protected]
Copy ./resources/[email protected]
Copy ./resources/[email protected]
Create ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app.dSYM
Simulate ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app
(main)> rake aborted!
Interrupt:
/Library/RubyMotion/lib/motion/project/template/ios.rb:235:in `system'
/Library/RubyMotion/lib/motion/project/template/ios.rb:235:in `block in <top (required)>'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-screenshots-0.1.1/lib/motion-screenshots.rb:96:in `block (2 levels) in <top (required)>'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks:15:in `eval'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => default => simulator
(See full trace by running task with --trace)
Re-installing pods...
rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - vendor/Pods/Target Support Files/Pods/Pods-resources.sh
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:305:in `initialize'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:305:in `open'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:305:in `resources'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:238:in `install_resources'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:230:in `install!'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:348:in `block (2 levels) in <top (required)>'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks:15:in `eval'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => pod:install
(See full trace by running task with --trace)
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks: Interrupt
Thanks for uploading the example project, that helps with debugging. I couldn't get it to work either - looks like some of the internal RubyMotion/CocoaPods behavior this used changed with RubyMotion 3
I don't have more time to fix it unfortunately =\ there are probably other projects which do this (either for RubyMotion or generic CocoaPods - maybe https://github.com/terriblelabs/motion-juxtapose would work?), and I'd be happy to merge any PRs that fix it