Live Preview not working

I’m using FuseTools version 1.0.1 (build 13566) on the latest generation MBP running OSX Sierra version 10.12.5.

Last week, I was able to export a build via $fuse build --target=ios --run to load the Fuse app into XCode. After this I was able to click the “Play” button within XCode and got the app to run, even after disconnecting the USB-C cable. The app was nice and fast.

Today, I updated code and wanted to test a new build on phone but ran into foreign looking errors shown below. For reference, my Fuse app still runs fine in preview mode. Here’s my CLI audit trail.

$fuse build --target=ios --run
Uno 1.0.12 (build 5387) OS X 10.12 i386 620e8e3
Configuring
Target is up-to-date -- stopping build (pass --force to override)
Build completed in 0.19 seconds
---
[....] Waiting for iOS device to be connected
[....] Using f455d27bf08dddee6f8b9173310d02e9a18c4daa (D11AP, iPhone 7 Plus, iphoneos, arm64) a.k.a. 'CALVIN’s iPhone7 Plus'.
------ Install phase ------
[  0%] Found f455d27bf08dddee6f8b9173310d02e9a18c4daa (D11AP, iPhone 7 Plus, iphoneos, arm64) a.k.a. 'CALVIN’s iPhone7 Plus' connected through USB, beginning install
[  5%] Copying /Users/calvinnguyen/safezone/projects/mobile/fuse/samples/instafit/build/iOS/Debug/build/Release-iphoneos/instafit.app/META-INF/ to device
...
<Then the errors>
[100%] Installed package build/Release-iphoneos/instafit.app
------ Debug phase ------
Starting debug of f455d27bf08dddee6f8b9173310d02e9a18c4daa (D11AP, iPhone 7 Plus, iphoneos, arm64) a.k.a. 'CALVIN’s iPhone7 Plus' connected through USB...
[  0%] Looking up developer disk image
[ 95%] Developer disk image mounted successfully
[100%] Connecting to remote debug server
-------------------------
(lldb) command source -s 0 '/tmp/7C13992A-4974-499B-886F-677CA47FF008/fruitstrap-lldb-prep-cmds-f455d27bf08dddee6f8b9173310d02e9a18c4daa'
Executing commands in '/tmp/7C13992A-4974-499B-886F-677CA47FF008/fruitstrap-lldb-prep-cmds-f455d27bf08dddee6f8b9173310d02e9a18c4daa'.
(lldb)     platform select remote-ios --sysroot '/Users/calvinnguyen/Library/Developer/Xcode/iOS DeviceSupport/10.3.2 (14F89)/Symbols'
  Platform: remote-ios
 Connected: no
  SDK Path: "/Users/calvinnguyen/Library/Developer/Xcode/iOS DeviceSupport/10.3.2 (14F89)/Symbols"
(lldb)     target create "/Users/calvinnguyen/safezone/projects/mobile/fuse/samples/instafit/build/iOS/Debug/build/Release-iphoneos/instafit.app"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python/lldb/__init__.py", line 98, in <module>
    import six
ImportError: No module named six
...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
error: python failed attempting to evaluate 'fruitstrap_device_app="/private/var/containers/Bundle/Application/B8940E1C-02BA-4545-B114-AB098831CC4E/fit4l.app"'

I’ve waited up to 10+ minutes and ultimately CTRL+C to to exit after 10+minutes of stalled output. I’m searched the forums and google but feel stuck and would appreciate insight on what I’ve done wrong and how I might fix the error.

Hi Calvin,

when you add -r to the build command, Fuse tries to install and run the app directly on connected USB device(s). If you run fuse build --help you will find that you can open XCode by supplying a -d argument.

So, to start a preview (that does live update), you run: fuse preview -tios.

And to make a release build (that opens in XCode), you run: fuse build -tios -d -cRelease

Optionally, you can add -DCOCOAPODS flag to both commands if you’re using any third party frameworks on your iOS build.

Hope this helps!

Hi Uldis. Sorry about the erroneous title with my post that may have confused matters. I appreciate the the summary and those additional CLI switches. Let me try to clarify. I’m able to successfully build when I remove the -r/–run switch from the fuse build -tiOS -r but receive this error if I include it.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
error: python failed attempting to evaluate 'fruitstrap_device_app="/private/var/containers/Bundle/Application/B8940E1C-02BA-4545-B114-AB098831CC4E/fit4l.app"'

Any ideas on why I might get this following error and do I lose anything by omitting -r or is it just handy switch to run the app after the build has been built and installed?

Not sure where the error comes from, but the internet says that it’s probably not directly related to Fuse, but rather your system. See this for an example and do a google search on the error, you might find a solution somewhere.

As for the flag itself, using -r does just that: bypasses opening an IDE (Android Studio or XCode, depending on the target platform), and installs the app right onto a connected device. So, no, you don’t lose anything if you can still open an IDE and run the preview/build from there.