xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.48k stars 515 forks source link

Can't upload iOS app to the device with mtouch #10374

Closed rotanov closed 3 years ago

rotanov commented 3 years ago

Steps to Reproduce

We executed mtouch from internal tool to upload bulds to the device. It stopped working a couple of years ago but people just stopped using tool and started doing builds with VS. I tried to fix it, so what changed is mtouch location. From /Developer/MonoTouch/usr/bin/mtouch to /Library/Frameworks/Xamarin.iOS.framework/Current/bin/mtouch I'm not sure if this was mentioned in change logs of Xamarin.iOS.

  1. /Library/Frameworks/Xamarin.iOS.framework/Current/bin/mtouch --sdkroot=/Applications/Xcode.app --installdev=<path_to_app>

A target framework (--target-framework) must be specified

It's not clear how do I get the list of possible target frameworks and the syntax.

And not mentioned here https://docs.microsoft.com/en-us/xamarin/ios/deploy-test/mtouch#deploying-to-a-device or here http://docs.go-mono.com/?link=man%3amtouch(1) (which first link refers to as reference for mtouch)

Trying to guess the arguments:

  1. /Library/Frameworks/Xamarin.iOS.framework/Current/bin/mtouch --sdkroot=/Applications/Xcode.app --installdev=<path_to_app> --target-framework

Missing required value for option...

Trying to guess further:

  1. /Library/Frameworks/Xamarin.iOS.framework/Current/bin/mtouch --sdkroot=/Applications/Xcode.app --installdev=<path_to_app> --target-framework=Xamarin.iOS

Invalid value.

Trying to guess further:

  1. /Library/Frameworks/Xamarin.iOS.framework/Current/bin/mtouch --sdkroot=/Applications/Xcode.app --installdev=<path_to_app> --target-framework=Xamarin.iOS,v14.6.0.15

Invalid target framework: Xamarin.iOS,v14.6.0.15. Valid target frameworks are: Xamarin.iOS,Version=v1.0, Xamarin.WatchOS,Version=v1.0, Xamarin.TVOS,Version=v1.0, .NETCoreApp,Version=v5.0,Profile=ios, .NETCoreApp,Version=v5.0,Profile=tvos, .NETCoreApp,Version=v5.0,Profile=watchos

I've got the list of possible values. Though it's strange that Xamarin.iOS is still v1.0. I thought it's v14.6.0.15. Whatever.

  1. /Library/Frameworks/Xamarin.iOS.framework/Current/bin/mtouch --sdkroot=/Applications/Xcode.app --installdev=<path_to_app> --target-framework=Xamarin.iOS,v1.0

MT0010: Could not parse the command line arguments: System.AggregateException: One or more errors occurred + part of stack trace.

Oh well.

Expected Behavior

I think what expected is:

  1. It should somehow work in the end when I provide a valid option from the list provided by mtouch
  2. If mtouch requires this argument in order to upload app to device it should be mentioned in docs
  3. possible values for this argument should be mentioned whenever it's missed if required or something invalid is provided
  4. possible values should also be mentioned in docs
  5. versions should not be misleading. Like if current version of Xamarin.iOS is 14.6.0.15 I shouldn't be expected to provide Xamarin.iOS v1.0 somewhere.

Actual Behavior

Mtouch doesn't upload app to an iOS devices, error messages are not clear, there's nothing in Docs, it's not clear what to do, Versions are inconsistent.

Environment

I have .net 5 for Mac installed. Mac mini late 2014. XCode 12

=== Visual Studio Community 2019 for Mac ===

Version 8.8.4 (build 30)
Installation UUID: 215ce9e8-299e-4ade-ad6c-aa2dfac1b981
  GTK+ 2.24.23 (Raleigh theme)
  Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

  Package version: 612000113

=== Mono Framework MDK ===

Runtime:
  Mono 6.12.0.113 (2020-02/4fdfb5b1fd5) (64-bit)
  Package version: 612000113

=== Roslyn (Language Service) ===

3.8.0-5.20519.18+4c195c3ac1974edcefa76774d7a59a2350ec55fa

=== NuGet ===

Version: 5.8.0.6860

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/5.0.101/Sdks
SDK Versions:
  5.0.101
  5.0.100
  3.1.404
  3.1.403
  3.1.101
  3.1.100
  3.0.100
  2.1.811
  2.1.701
  2.1.505
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
  5.0.1
  5.0.0
  3.1.10
  3.1.9
  3.1.1
  3.1.0
  3.0.0
  2.1.23
  2.1.15
  2.1.14
  2.1.13
  2.1.12
  2.1.9

=== .NET Core 3.1 SDK ===

SDK: 3.1.404

=== Xamarin.Profiler ===

Version: 1.6.12.29
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.3 (17715)
Build 12C33

=== Xamarin.Mac ===

Version: 7.0.0.15 (Visual Studio Community)
Hash: 87a1b18d8
Branch: d16-8
Build date: 2020-11-16 21:39:40-0500

=== Xamarin.iOS ===

Version: 14.6.0.15 (Visual Studio Community)
Hash: 87a1b18d8
Branch: d16-8
Build date: 2020-11-16 21:39:41-0500

=== Xamarin Designer ===

Version: 16.8.0.510
Hash: 44e3f3ce9
Branch: remotes/origin/d16-8
Build date: 2020-12-10 00:06:14 UTC

=== Xamarin.Android ===

Version: 11.1.0.17 (Visual Studio Community)
Commit: xamarin-android/d16-8/c0e2b8e
Android SDK: /Users/gameforest/Library/Developer/Xamarin/android-sdk-macosx
  Supported Android versions:
    4.4    (API level 19)
    4.4.87 (API level 20)
    7.1    (API level 25)
    8.0    (API level 26)
    8.1    (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.5
SDK Build Tools Version: 29.0.2

Build Information: 
Mono: be2226b
Java.Interop: xamarin/java.interop/d16-8@79d9533
ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
SQLite: xamarin/sqlite/3.32.1@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/gameforest/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.8.0.32
Hash: 01a7774
Branch: remotes/origin/d16-8
Build date: 2020-12-10 00:32:24 UTC

=== Android Device Manager ===

Version: 16.8.0.46
Hash: 0a81419
Branch: remotes/origin/d16-8
Build date: 2020-12-10 00:32:44 UTC

=== Build Information ===

Release ID: 808040030
Git revision: eaa21a8983aa5c4bcf6a665892478b4f3d413418
Build date: 2020-12-10 11:06:12-05
Build branch: release-8.8
Xamarin extensions: eaa21a8983aa5c4bcf6a665892478b4f3d413418

=== Operating System ===

Mac OS X 10.16.0
Darwin 20.2.0 Darwin Kernel Version 20.2.0
    Wed Dec  2 20:39:59 PST 2020
    root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64

Build Logs

image image

rolfbjarne commented 3 years ago

Can you try using mlaunch (/Library/Frameworks/Xamarin.iOS.framework/Current/bin/mlaunch) instead of mtouch?

rotanov commented 3 years ago

Yes, it just works. Thank you. Is it documented somewhere?

rolfbjarne commented 3 years ago

That's great!

Is it documented somewhere?

Using mtouch directly to install or launch applications on device was never a supported option, which means there was never much documentation about it either (and that continues with mlaunch).

So I'm going to close this issue.

rotanov commented 3 years ago

That's great!

Is it documented somewhere?

Using mtouch directly to install or launch applications on device was never a supported option, which means there was never much documentation about it either (and that continues with mlaunch).

So I'm going to close this issue.

As I mentioned it's support was and still is documented here https://docs.microsoft.com/en-us/xamarin/ios/deploy-test/mtouch#deploying-to-a-device