Question: How do I create an APK installer for mobile without the react native simulator? This is what happened when I tried to install the APK on Android.

[![enter image description here](https://i.stack.imgur.com/MJ179.png)](https://i.stack.imgur.com/MJ179.png)

Answer: 
I found the simplest way so far. I know this is already answered and accepted also but it is not working in the current scenarios because `ng init` is [removed](https://github.com/angular/angular-cli/blob/ed5f47dc22d5eb4a5d4b4ae2c8f7cb0ec1a999f3/CHANGELOG.md) so if you have forgotten to add routing while creating new project than you can add routes to existing project as following steps. Hope it will be helpful.

First of all add `app-routing.module.ts` file in your src --> app folder

**app-routing.module.ts** file would be like this

```
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home/home.component';     // Add your component here
import { AboutComponent } from './about/about.component';  // Add your component here

//This is my case 
const routes: Routes = [
    {
        path: '',
        component: HomeComponent
    },
    {
        path: 'about',
        component: AboutComponent
    }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }

```

Then **Import** `app-routing.module.ts` file in `app.module.ts` file as follow.

**app.module.ts**

```
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module'; // Added here

```

Now you will be able to perform routing task.
In Angular 5/6 you can use these commands to add routing to an existing project.

1. `ng generate module app-routing --flat --module=app`

--flat puts the file in src/app instead of its own folder.
--module=app tells the CLI to register it in the imports array of the AppModule.

This will generate the file `src/app/app-routing.module.ts` for you.

2. Now inside `src/app/app-routing.module.ts` you have to import the router code:

import { RouterModule, Routes } from '@angular/router';
3. Further, edit `src/app/app-routing.module.ts` to look like this:

```
    import { RouterModule, Routes, Router } from '@angular/router';
    import {class name} from 'address your component Component';
    const routes: Routes = [
      { path: '/home' , component : yourComponenetName}
    ];
    @NgModule({
      imports: [
        RouterModule.forRoot(routes)
      ],
      exports: [ RouterModule ]
    })
    export class AppRoutingModule { } 

```

4. Next, add the `router-outlet` tag to your `app.html` file to tell the router where to display routed views.

```
    <router-outlet></router-outlet>

```

5. Additionally, you should check in an `index.html` file with this tag at the top.

```
    <base href="/"> 

```

It will be added directly if you use the CLI command that I mention above.