Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gluonfx:nativerun fails on M1 Mac with XCODE 15 and iOS17 #493

Open
tmulle opened this issue Oct 12, 2023 · 9 comments
Open

gluonfx:nativerun fails on M1 Mac with XCODE 15 and iOS17 #493

tmulle opened this issue Oct 12, 2023 · 9 comments

Comments

@tmulle
Copy link

tmulle commented Oct 12, 2023

When trying to run the application on my connected iPad using the latest version of Gluon Mobile, I get an error:

I found this link about using XCODE 15 and iOS17 which I am currently using on my mobile devices.
I'm also using Sonoma on my M1 Mac.

  1. https://developer.apple.com/forums/thread/731236
  2. DeveloperDiskImage.dmg for iOS 17 not found in Xcode 15 ios-control/ios-deploy#588

That second link talks about a workaround of using the apple tools to launch the app. BUT I don't get any log/debug output so I can't see any logging or errors when running my app on my iPad.

The application works fine running on the desktop but fails to run parts on the iPad so I have no way of figuring out what is wrong.

I can manually launch the app on the iPad but tapping on the icon, but I really need debugging/logging to troubleshoot.

[INFO] --- gluonfx-maven-plugin:1.0.21:nativerun (default-cli) @ bcfx ---
[Thu Oct 12 09:27:47 EDT 2023][INFO] ==================== RUN TASK ====================
[Thu Oct 12 09:27:53 EDT 2023][INFO] [SUB] [....] Waiting for iOS device to be connected
[Thu Oct 12 09:27:53 EDT 2023][INFO] [SUB] [....] Using 00008101-000D541104B82C3A (J307AP, iPad Air 4, iphoneos, arm64e, 17.0.3, 21A360) a.k.a. 'Tim’s iPad'.
[Thu Oct 12 09:27:53 EDT 2023][INFO] [SUB] ------ Debug phase ------
[Thu Oct 12 09:27:53 EDT 2023][INFO] [SUB] Starting debug of 00008101-000D541104B82C3A (J307AP, iPad Air 4, iphoneos, arm64e, 17.0.3, 21A360) a.k.a. 'Tim’s iPad' connected through USB...
[Thu Oct 12 09:27:53 EDT 2023][INFO] [SUB] 2023-10-12 09:27:53.975 ios-deploy[81544:2371991] [ !! ] Unable to locate DeviceSupport directory with suffix 'DeveloperDiskImage.dmg'. This probably means you don't have Xcode installed, you will need to launch the app manually and logging output will not be shown!
[Thu Oct 12 09:27:53 EDT 2023][INFO] App was launched successfully
@tmulle
Copy link
Author

tmulle commented Oct 23, 2023

Has anyone else run into this? 2 weeks and not even a comment?

Is anyone using gluonfx with iOS anymore? especially the new versions of the Apple tools?

I can't develop effectively on iOS if I can't debug the application.

Any ideas how I can get debugging/logging working?

@jperedadnr
Copy link
Contributor

The fact that libimobiledevice and iOS-deploy are "broken" with Xcode 15 should give you an idea that this is a major issue. Until they get a fix (or Apple releases a new version of devicectl that allows debug logs), I don't see how we can fix this.
I'm personally holding off the migration to Sonoma...

As a possible workaround, though, you could try forwarding all err/out logs to a file that you can see from your app or remotely.

@jperedadnr
Copy link
Contributor

jperedadnr commented Nov 5, 2023

More options: using the Console appp just works...

If you use Attach, you can easily look for AttachLog:

image

and if you set System.setProperty(Constants.ATTACH_DEBUG, "true"); you can look for [DEBUG]:
image

Of course, this only applies to the printouts from the iOS native implementation (Attach one for now, not JavaFX)

@cbm64chris
Copy link

It’s not exactly a solution but unless your on Sonoma you can still install Xcode 14. I accidentally upgraded to Sonoma where 14 is nerfed. However, running from the binary in the terminal meant 14 installed the right components that allow iOS-sim deploy etc.

@aardy1
Copy link

aardy1 commented Feb 6, 2024

It’s not exactly a solution but unless your on Sonoma you can still install Xcode 14. I accidentally upgraded to Sonoma where 14 is nerfed. However, running from the binary in the terminal meant 14 installed the right components that allow iOS-sim deploy etc.

Can you give more details on what you mean here by "running from the binary in the terminal"? Is that on Sonoma?

@cbm64chris
Copy link

@aardy1 have you installed Xcode 14? If you have, you'll see that you cannot execute from the app package. However you can execute the Xcode 14 from the binary in the package and it will install everything you need to continue working. Probably at this location: ./Applications/Xcode.app/Contents/MacOS/Xcode

@salmonb
Copy link

salmonb commented Feb 23, 2024

I have a similar issue on my old iMac 2014 with old macOS (Big Sur 11.7.10), gluonfx:nativerun fails as follow:


[Fri Feb 23 11:31:50 GMT 2024][INFO] ==================== RUN TASK ====================
[Fri Feb 23 11:31:55 GMT 2024][INFO] [SUB] [....] Waiting for iOS device to be connected
[Fri Feb 23 11:31:55 GMT 2024][INFO] [SUB] [....] Using 00008110-000C24D43A84801E (J310AP, iPad mini 6, iphoneos, arm64e, 17.3.1, 21D61) a.k.a. 'iPad mini'.
[Fri Feb 23 11:31:55 GMT 2024][INFO] [SUB] ------ Debug phase ------
[Fri Feb 23 11:31:55 GMT 2024][INFO] [SUB] Starting debug of 00008110-000C24D43A84801E (J310AP, iPad mini 6, iphoneos, arm64e, 17.3.1, 21D61) a.k.a. 'iPad mini' connected through USB...
[Fri Feb 23 11:31:59 GMT 2024][INFO] [SUB] Error: The argument is invalid.
[Fri Feb 23 11:31:59 GMT 2024][INFO] [SUB] 2024-02-23 11:31:59.039 ios-deploy[42911:3478650] [ !! ] Unable to mount developer disk image. (e8000007)
[Fri Feb 23 11:31:59 GMT 2024][INFO] App was launched successfully

brew list --versions gives me the the following libraries versions I'm using:

  • ios-deploy 1.12.2
  • libusbmuxd 2.0.2_1
  • libimobiledevice 1.3.0_2

Am I correct to diagnose from The argument is invalid that the way Gluon calls these libraries is not working anymore with these new versions?

BTW is it the same issue as above, or should I open a different one?

@jperedadnr
Copy link
Contributor

jperedadnr commented Apr 5, 2024

Update: There are some working solutions, outside of ios-deploy (not ready to be integrated with Substrate for now):

see https://github.com/doronz88/pymobiledevice3

These are the steps to get logs on a terminal with lldb:

  • Install pymobiledevice3:
python3 -m pip install -U pymobiledevice3
  • Connect iPhone through USB, and unlock it.

  • Run from terminal 1:

% sudo python3 -m pymobiledevice3 remote start-tunnel --script-mode                              
Password:
2024-04-05 12:08:22 MacBook-Pro.local pymobiledevice3.cli.remote[5421] INFO tunnel created
fd85:8523:ce69::1 60108
  • Run from terminal 2:
% xcrun devicectl device install app --device 00008110-001125DXXXXXX /path.to/MyApp.app
12:07:16  Acquired tunnel connection to device.
12:07:16  Enabling developer disk image services.
12:07:31  Acquired usage assertion.
1%... 2%... 3%... 4%... 5%... 6%... 7%... 8%... 9%... 10%... 11%... 12%... 13%... 14%... 15%... 16%... 18%... 19%... 20%... 21%... 22%... 23%... 24%... 25%... 26%... 27%... 28%... 30%... 31%... 32%... 33%... 34%... 35%... 36%... 37%... 38%... 39%... 40%... 41%... 42%... 43%... 44%... 45%... 46%... 47%... 48%... 49%... 50%... 51%... 52%... 53%... 54%... 55%... 56%... 57%... 59%... 60%... 62%... 66%... 68%... 72%... 76%... 80%... 84%... 88%... 92%... 96%... Complete!
App installed:
• bundleID: com.myapplication.myapp
• installationURL: file:///private/var/containers/Bundle/Application/22F5DBE4-47E4-475A-8554-5277E85XXXXX/MyApp.app/
• launchServicesIdentifier: unknown
• databaseUUID: 7F314827-9E5B-4DCC-B047-CFB787XXXXX
• databaseSequenceNumber: 2080
• options: 
  • Run from terminal 2:
% sudo python3 -m pymobiledevice3 developer debugserver start-server --rsd fd85:8523:ce69::1 60108
Password:

Follow the following connections steps from LLDB:

(lldb) platform select remote-ios
(lldb) target create /path/to/local/application.app
(lldb) script lldb.target.module[0].SetPlatformFileSpec(lldb.SBFileSpec('/private/var/containers/Bundle/Application/<APP-UUID>/application.app'))
(lldb) process connect connect://[fd85:8523:ce69::1]:53187   <-- ACTUAL CONNECTION DETAILS!
(lldb) process launch
  • Run from terminal 3:
% lldb
(lldb) platform select remote-ios
  Platform: remote-ios
 Connected: no
  SDK Path: "/Users/user/Library/Developer/Xcode/iOS DeviceSupport/iPhone14,8 17.4.1 (21E236)"
 SDK Roots: [ 0] "/Users/user/Library/Developer/Xcode/iOS DeviceSupport/iPhone14,8 17.4.1 (21E236)"
(lldb) target create /path.to/MyApp.app
Current executable set to '/path.to/MyApp.app' (arm64).
(lldb) script lldb.target.module[0].SetPlatformFileSpec(lldb.SBFileSpec('/private/var/containers/Bundle/Application/22F5DBE4-47E4-475A-8554-5277E85XXXXX/MyApp.app'))
True
(lldb) process connect connect://[fd85:8523:ce69::1]:53187                                                 
(lldb) run
Process 709 launched: '/path.to/MyApp.app/MyApp' (arm64)
MyApp(709,0x206757f00) malloc: Unable to set up reclaim buffer (46) - disabling large cache
determineCpuFeaures
Apr 05, 2024 1:28:28 PM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @4563e9ab'
IOSWindowSystemInterface : share 0 view 0 pf otready 
GL_VERSION string = OpenGL ES 2.0 Metal - 99
GL_VERSION (major.minor) = 0.0
  initialize() returns 4368422048
IOSWindowSystemInterface : share 2199980 view 0 pf otready 
GL_VERSION string = OpenGL ES 2.0 Metal - 99
GL_VERSION (major.minor) = 0.0
...
(lldb)exit

@jperedadnr
Copy link
Contributor

Here is another way to get all output to a terminal:
Plug iPhone, start Xcode, select Xcode -> Open Developer Tool -> Instruments, open Blank instruments, press + Instrument, and select stderr/stdout:
image

Then select your application to run from the top, and press start recoding. It will open the app, and while running it you will get the whole output:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants