Dear Adrian,
it is possible to start an application from Xcode and attach a JDWP debugger after it launched.
For simulator:
- Open the Xcode project
- Open the Scheme editor
- In the “Run” section go to the “Arguments” tab and add the following arg:
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
(if you don’t want the application to wait for the debugger to connect, then use suspend=n
)
4. Launch the application from Xcode
5. Create a “Remote” run configuration in Android Studio
6. Set it up to connect to the port specified above (5005)
Note: when using suspend=y
, JDWP needs to connect quickly (less than about 30s), otherwise iOS might kill the app.
For devices:
- Do the same as for the simulator until (including) step 4.
- Open terminal and type
cd ~/.moe/moe-sdk-1.1.0/tools/
java -jar ios-device.jar --debug=5005
- Continue from step 5.
If you need the other way around, attaching Xcode to an already running MOE application (which was launched from MOE’s launcher), that is unsupported.