Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6345] Running osascript sim_focus.scpt hangs for 7-8 minutes when running iOS Alloy app in emulator

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2019-12-20T16:01:25.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterJoe
AssigneeMotiur Rahman
Created2019-08-24T00:51:48.000+0000
Updated2019-12-20T16:01:25.000+0000

Description

Steps to Reproduce

Two weeks ago I updated to Studio 5.1.3.201907112159, CLI 7.1.0 and SDK 8.1.0 GA. Now when running an alloy project in the iOS simulator, studio hangs after about 7-8 minutes after : [TRACE] : [ioslib] Running: osascript ....sim_focus.scpt 'Simulator' The emulator is displayed immediately but it takes 7+ minutes before the next trace log '[TRACE] : [ioslib] iPhone 8 Simulator successfully focused' is displayed. Once the app is shown in emulator, changes to alloy project code do reload the app in emaulator as expected. I tried to resolve this issue by changing to CLI 7.0.12 (appc use 7.0.12) and also tried using 8.0.2GA SDK - but neither resolved this issue.

Actual Result

Simulator hangs for 8 minutes before displaying the app

Expected Result

Simulator should display the app quickly after simulator is activated

Attachments

FileDateSize
.log2019-08-24T00:51:49.000+0000200256
build_iphone_CLI_7.0.12_SDK_8.0.2GA.log2019-08-27T15:58:51.000+000090597
build_iphone_CLI_7.1.0_SDK_8.1.0GA.log2019-08-27T15:58:53.000+00001720832
diagnostic8252406049545079499.log2019-08-24T00:51:58.000+0000437722

Comments

  1. Joe 2019-08-24

    I'm surprised nobody is reporting this same issue. I have a standard and clean environment. I previously thought I was able able to resolve this by using CLI 7.0.12 but that wasn't the case. I have tried every which way to clean/build, use different simulators etc. without any progress. Any suggestions / ideas? Node version? OS version/feature? Is there any type of AppleScript logging/trace I can turn on that may help?
  2. Joe 2019-08-24

  3. Ewan Harris 2019-08-26

    [~NewportSolutions], if you build your project from the CLI using DEBUG=*,-babel appc run -p ios (with Studio closed) do you see the same difference in time between the log output? If you could upload that log output it might contain some info that could help us debug your issue
  4. Joe 2019-08-27

    I was able to build using the CLI as instructed and the default simulator opened and displayed the app immediately. I also tried choosing a specific simulator (one that delays when building with Studio) and the app displays immediately - as it should. I will upload the log output from studio.
  5. Joe 2019-08-27

    I just ran the app from Studio and again almost exactly 10 minutes staring at the simulator until you see the app gets installed and opens immediately. I cleared the Studio log file before the running the app and the log file is empty (I think you meant that log file). I also ran NOT using LiveView and am experience the same result - simulator opens, 10 mins goes by, then app installs and opens in simulator.
  6. Rene Pot 2019-08-27

    How does it behave when you compile via CLI instead of studio?
  7. Ewan Harris 2019-08-27

    [~NewportSolutions], I meant the log output from a build. You can find a file in the build directory called build_iphone.log or you can just copy and paste it into a text file from the terminal/studio output. Based off all the information you've provided this does look identical to TIMOB-27102, it only occurs in Studio, happens in the identical place etc, is the app you're building definitely using 8.0.2.GA or higher?
  8. Joe 2019-08-27

    Yes - I am sure about 8.0.2GA or higher and have just ran two clean tests with log files attached. I cleaned and built the app to run on a simulator using CLI 7.0.12 and SDK 8.0.2GA - same results, log file attached. I cleaned and built the app to run on a simulator using CLI 7.1.0 and SDK 8.1.0GA - same results, log file attached.
  9. Joe 2019-09-02

    Could this issue be caused by the Node version installed? I am using Node v8.9.4 but looks like I could upgrade to 8.16.x according to the [Titanium Compatibility Matrix](https://docs.appcelerator.com/platform/latest/#!/guide/Titanium_Compatibility_Matrix-section-src-29004837_TitaniumCompatibilityMatrix-Node.js).
  10. Rene Pot 2019-09-03

    I'm not sure that could improve anything. Did you by any chance upgrade Java as well? And what version of Java/JDK are you running?
  11. Joe 2019-09-03

    No Java updates. Here's what I have installed: java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) What script is running when this is displayed, "Running: osascript ....sim_focus.scpt 'Simulator' "? The sim_focus.scpt is working, it's the script/process that runs sim_focus.scpt that is not responding. This is killing me and hard to believe I'm the only one having this issue. Maybe some type of environment / config issue...
  12. Joe 2019-09-05

    Upgrading to Node 8.16 did not help and neither did SDK 8.1.1.GA. I did find a mention that [Node 8.16.0 is "required" for Studio 5.1.3+](https://docs.appcelerator.com/platform/latest/#!/guide/Titanium_Compatibility_Matrix-section-src-29004837_safe-id-VGl0YW5pdW1Db21wYXRpYmlsaXR5TWF0cml4LVN0dWRpb05vZGUsQ0xJLGFuZFRpdGFuaXVtU0RLc3VwcG9ydGVkdmVyc2lvbnM) in the docs. Can either of you ( @topener @eharris ) tell me what process is running when this is displayed, "Running: osascript ....sim_focus.scpt 'Simulator' "? The sim_focus.scpt is working fine - it's the script/process that runs sim_focus.scpt that is not responding.
  13. Sharif AbuDarda 2019-09-19

    Hello [~NewportSolutions], What happens if you run from the terminal inside the studio. Can you run with the DEBUG=*,-babel appc run -p ios -l trace? Click on the terminal icon in the studio to open the terminal inside the studio and run this command. You can run your choice of the simulator with the -C tag. And putting the simulator UUID in there. Let us know. Thanks.
  14. Joe 2019-09-20

    I ran the app (and other apps) using this method with the same result - 10 full minutes after Simulator launches before the app install is triggered. Running the app using the console inside studio did not reveal anything as far as I can tell. See below:
        [TRACE] [ioslib] Simulator is not running
        [TRACE] [ioslib] Tailing iPhone 7 Plus Simulator system log: /Users/corriere/Library/Logs/CoreSimulator/1BA01321-E0FD-4F1C-9E6C-9E8FF4FEC32B/system.log
          ioslib:simctl Running: /Applications/Xcode.app/Contents/Developer/usr/bin/simctl list --json +3m
          ioslib:simctl Sim state: Shutdown +210ms
        [TRACE] [ioslib] Running: /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator -CurrentDeviceUDID 1BA01321-E0FD-
        4F1C-9E6C-9E8FF4FEC32B
          ioslib:simctl Running: /Applications/Xcode.app/Contents/Developer/usr/bin/simctl list --json +3ms
          ioslib:simctl Running: /Applications/Xcode.app/Contents/Developer/usr/bin/simctl list --json +531ms
          always-tail reading: +0ms 24 3830 127649
        [TRACE] [ioslib] Simulator is booted
        [TRACE] [ioslib] iPhone 7 Plus Simulator started
        [TRACE] [ioslib] Running: osascript "/Users/corriere/Library/Application Support/Titanium/mobilesdk/osx/8.1.0.GA/node_modules/ioslib/lib/sim_focus.scpt" "
        Simulator"
          always-tail reading: +501ms 24 611 131479
          always-tail reading: +500ms 24 3608 132090
          always-tail reading: +505ms 24 10167 135698
          always-tail reading: +501ms 24 2728 145865
          always-tail reading: +500ms 24 2962 148593
        ........[*** WAIT 10 FULL MINUTES !!! ***]........
          always-tail reading: +2.4m 24 4747 223162
          always-tail reading: +1s 24 241 227909
          always-tail reading: +40s 24 216 228150
          always-tail reading: +1.9m 24 2253 228366
          always-tail reading: +1s 24 1728 230619
          always-tail reading: +11s 24 206 232347
        [TRACE] [ioslib] iPhone 7 Plus Simulator successfully focused
        [TRACE] [ioslib] Installing the app
        
  15. Joe 2019-09-20

    BTW I can use and interact with Simulator immediately after it is started (booted). But sim_focus.scpt does not "seem" to complete for 10 minutes.
  16. Sharif AbuDarda 2019-11-04

    Hello, What's the update of the issue on the latest SDK 8.2.1.GA?
  17. Joe 2019-12-20

    I stopped using Studio altogether and now use VS Code without any problems. Studio still has the issue regardless of the SDK version. This has not been resolved but since nobody else seemed to report this issue perhaps you should close it.
  18. Motiur Rahman 2019-12-20

    [~NewportSolutions] Thanks for your update. I tested with the latest Studio v5.1.4.201909061933 and it's working faster. Here is my testing environment. Appcelerator Command-Line Interface, version 7.1.2 Name = Mac OS X Version = 10.14.6 Node.js Node.js Version = 10.16.3 npm Version = 6.9.0 Titanium CLI CLI Version = 5.2.2 Titanium SDK SDK Version = 8.3.0.GA So I am going to close it. If you experience the same issue with the latest environment then you can raise another ticket. Thanks!

JSON Source