Move buildable module test to a module test (#36102)

diff --git a/dev/devicelab/bin/tasks/module_test_ios.dart b/dev/devicelab/bin/tasks/module_test_ios.dart
index d24359e..a54b555 100644
--- a/dev/devicelab/bin/tasks/module_test_ios.dart
+++ b/dev/devicelab/bin/tasks/module_test_ios.dart
@@ -32,7 +32,7 @@
       });
       await prepareProvisioningCertificates(projectDir.path);
 
-      section('Build ephemeral host app without CocoaPods');
+      section('Build ephemeral host app in release mode without CocoaPods');
 
       await inDirectory(projectDir, () async {
         await flutter(
@@ -41,18 +41,96 @@
         );
       });
 
-      final bool ephemeralHostAppBuilt = exists(Directory(path.join(
+      final Directory ephemeralReleaseHostApp = Directory(path.join(
         projectDir.path,
         'build',
         'ios',
         'iphoneos',
         'Runner.app',
-      )));
+      ));
 
-      if (!ephemeralHostAppBuilt) {
+      if (!exists(ephemeralReleaseHostApp)) {
         return TaskResult.failure('Failed to build ephemeral host .app');
       }
 
+      if (!await _isAppAotBuild(ephemeralReleaseHostApp)) {
+        return TaskResult.failure(
+          'Ephemeral host app ${ephemeralReleaseHostApp.path} was not a release build as expected'
+        );
+      }
+
+      section('Clean build');
+
+      await inDirectory(projectDir, () async {
+        await flutter('clean');
+      });
+
+      section('Build ephemeral host app in profile mode without CocoaPods');
+
+      await inDirectory(projectDir, () async {
+        await flutter(
+          'build',
+          options: <String>['ios', '--no-codesign', '--profile'],
+        );
+      });
+
+      final Directory ephemeralProfileHostApp = Directory(path.join(
+        projectDir.path,
+        'build',
+        'ios',
+        'iphoneos',
+        'Runner.app',
+      ));
+
+      if (!exists(ephemeralProfileHostApp)) {
+        return TaskResult.failure('Failed to build ephemeral host .app');
+      }
+
+      if (!await _isAppAotBuild(ephemeralProfileHostApp)) {
+        return TaskResult.failure(
+          'Ephemeral host app ${ephemeralProfileHostApp.path} was not a profile build as expected'
+        );
+      }
+
+      section('Clean build');
+
+      await inDirectory(projectDir, () async {
+        await flutter('clean');
+      });
+
+      section('Build ephemeral host app in debug mode for simulator without CocoaPods');
+
+      await inDirectory(projectDir, () async {
+        await flutter(
+          'build',
+          options: <String>['ios', '--no-codesign', '--simulator', '--debug'],
+        );
+      });
+
+      final Directory ephemeralDebugHostApp = Directory(path.join(
+        projectDir.path,
+        'build',
+        'ios',
+        'iphonesimulator',
+        'Runner.app',
+      ));
+
+      if (!exists(ephemeralDebugHostApp)) {
+        return TaskResult.failure('Failed to build ephemeral host .app');
+      }
+
+      if (!exists(File(path.join(
+        ephemeralDebugHostApp.path,
+        'Frameworks',
+        'App.framework',
+        'flutter_assets',
+        'isolate_snapshot_data',
+      )))) {
+        return TaskResult.failure(
+          'Ephemeral host app ${ephemeralDebugHostApp.path} was not a debug build as expected'
+        );
+      }
+
       section('Clean build');
 
       await inDirectory(projectDir, () async {
@@ -179,3 +257,22 @@
     }
   });
 }
+
+Future<bool> _isAppAotBuild(Directory app) async {
+  final String binary = path.join(
+    app.path,
+    'Frameworks',
+    'App.framework',
+    'App'
+  );
+
+  final String symbolTable = await eval(
+    'nm',
+    <String> [
+      '-gU',
+      binary,
+    ],
+  );
+
+  return symbolTable.contains('kDartIsolateSnapshotInstructions');
+}
diff --git a/dev/integration_tests/ios_add2app/build_and_test.sh b/dev/integration_tests/ios_add2app/build_and_test.sh
index 0a533de..4c08afd 100755
--- a/dev/integration_tests/ios_add2app/build_and_test.sh
+++ b/dev/integration_tests/ios_add2app/build_and_test.sh
@@ -5,13 +5,7 @@
 cd "$(dirname "$0")"
 
 pushd flutterapp
-../../../../bin/flutter build ios --debug --no-codesign -v
-
-pushd .ios
-xcodebuild -workspace Runner.xcworkspace -scheme Runner -destination generic/platform=iOS -configuration Debug CODE_SIGNING_REQUIRED=NO CODE_SIGNING_IDENTITY="" CODE_SIGNING_ALLOWED=NO
-xcodebuild -workspace Runner.xcworkspace -scheme Runner -destination generic/platform=iOS -configuration Profile CODE_SIGNING_REQUIRED=NO CODE_SIGNING_IDENTITY="" CODE_SIGNING_ALLOWED=NO
-xcodebuild -workspace Runner.xcworkspace -scheme Runner -destination generic/platform=iOS -configuration Release CODE_SIGNING_REQUIRED=NO CODE_SIGNING_IDENTITY="" CODE_SIGNING_ALLOWED=NO
-popd
+../../../../bin/flutter build ios --debug --simulator --no-codesign
 popd
 
 pod install