Skip to content

How to automate an app without knowing its bundleId? #104

@rjlopez-designli

Description

@rjlopez-designli

Question / Problem

I'm trying to use Mobilewright to automate an iOS app that I do not own or have source access to. The issue is that I don't have the app's bundleId, and I'm not sure how to work around this.

From the docs I understand that bundleId is needed to launch an app, and that Mobilewright auto-detects it from project files like *.pbxproj, app.json, or build.gradle. However, in my case I'm trying to automate a third-party app already installed on the device/simulator — so none of those source files exist in my project.

What I've Tried So Far

Project setup (mobilewright v0.0.32, iOS, simulator):

mobilewright.config.ts:

import { defineConfig } from 'mobilewright';

export default defineConfig({
  testDir: './tests',
  reporter: 'html',
  platform: 'ios',
  deviceName: /🦖/,
});

tests/example.spec.ts:

import { test, expect } from '@mobilewright/test';

test('app launches and shows home screen', async ({ screen, device }) => {
  await expect(screen.getByText('Welcome')).toBeVisible();
});

Running npx mobilewright results in a failed test — likely because no bundleId is configured and the framework doesn't know which app to launch.

npx mobilewright doctor output:

  • ✅ 9/9 system checks pass (Node.js, Git, npm, mobilecli, Xcode, etc.)
  • ⚠️ 0 iOS simulators currently booted (22 available)
  • ❌ Android not fully configured (missing ANDROID_HOME/ADB) — not relevant for this case

Questions

  1. Is there a way to discover the bundleId of an app already installed on a simulator or device through Mobilewright or mobilecli?
  2. Is it possible to connect Mobilewright to an app that is already running (i.e., attach to a running process rather than launching by bundleId)?
  3. Should bundleId be passed somewhere in the config or via test.use({ bundleId: '...' }) — and if so, how do I find the right value for a third-party app?

Any guidance or workaround would be greatly appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions